Reindex the UTXO set after creating a new blockchain

This commit is contained in:
Ivan Kuznetsov 2017-09-17 12:37:45 +07:00
parent 99d1134beb
commit 4f0e04fde7
1 changed files with 5 additions and 1 deletions

View File

@ -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!")
}