blockchain_go/cli_createblockchain.go

20 lines
308 B
Go
Raw Normal View History

package main
2017-09-10 01:53:14 -05:00
import (
"fmt"
"log"
)
func (cli *CLI) createBlockchain(address, nodeID string) {
2017-09-10 01:53:14 -05:00
if !ValidateAddress(address) {
log.Panic("ERROR: Address is not valid")
}
bc := CreateBlockchain(address, nodeID)
defer bc.db.Close()
UTXOSet := UTXOSet{bc}
UTXOSet.Reindex()
fmt.Println("Done!")
}