2017-09-10 00:53:06 -05:00
|
|
|
package main
|
|
|
|
|
2017-09-10 01:53:14 -05:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
)
|
2017-09-10 00:53:06 -05:00
|
|
|
|
2017-09-30 22:42:34 -05:00
|
|
|
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")
|
|
|
|
}
|
2017-09-30 22:42:34 -05:00
|
|
|
bc := CreateBlockchain(address, nodeID)
|
2017-09-17 00:37:45 -05:00
|
|
|
defer bc.db.Close()
|
|
|
|
|
|
|
|
UTXOSet := UTXOSet{bc}
|
|
|
|
UTXOSet.Reindex()
|
|
|
|
|
2017-09-10 00:53:06 -05:00
|
|
|
fmt.Println("Done!")
|
|
|
|
}
|