From 4f0e04fde73ab75d3164fa71e107ab1e7583ed08 Mon Sep 17 00:00:00 2001 From: Ivan Kuznetsov Date: Sun, 17 Sep 2017 12:37:45 +0700 Subject: [PATCH] Reindex the UTXO set after creating a new blockchain --- cli_createblockchain.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli_createblockchain.go b/cli_createblockchain.go index 06ff1b1..358e88b 100644 --- a/cli_createblockchain.go +++ b/cli_createblockchain.go @@ -10,6 +10,10 @@ func (cli *CLI) createBlockchain(address string) { log.Panic("ERROR: Address is not valid") } bc := CreateBlockchain(address) - bc.db.Close() + defer bc.db.Close() + + UTXOSet := UTXOSet{bc} + UTXOSet.Reindex() + fmt.Println("Done!") }