diff --git a/blockchain.go b/blockchain.go index bd2e721..89aa373 100644 --- a/blockchain.go +++ b/blockchain.go @@ -68,7 +68,7 @@ func CreateBlockchain(address string) *Blockchain { } // NewBlockchain creates a new Blockchain with genesis Block -func NewBlockchain(address string) *Blockchain { +func NewBlockchain() *Blockchain { if dbExists() == false { fmt.Println("No existing blockchain found. Create one first.") os.Exit(1) diff --git a/cli_getbalance.go b/cli_getbalance.go index 27cb55e..c67c536 100644 --- a/cli_getbalance.go +++ b/cli_getbalance.go @@ -9,7 +9,7 @@ func (cli *CLI) getBalance(address string) { if !ValidateAddress(address) { log.Panic("ERROR: Address is not valid") } - bc := NewBlockchain(address) + bc := NewBlockchain() defer bc.db.Close() balance := 0 diff --git a/cli_printchain.go b/cli_printchain.go index cd5c7a0..8541d2f 100644 --- a/cli_printchain.go +++ b/cli_printchain.go @@ -6,7 +6,7 @@ import ( ) func (cli *CLI) printChain() { - bc := NewBlockchain("") + bc := NewBlockchain() defer bc.db.Close() bci := bc.Iterator() diff --git a/cli_reindexutxo.go b/cli_reindexutxo.go index e2d3717..e6f841f 100644 --- a/cli_reindexutxo.go +++ b/cli_reindexutxo.go @@ -3,7 +3,7 @@ package main import "fmt" func (cli *CLI) reindexUTXO() { - bc := NewBlockchain("") + bc := NewBlockchain() UTXOSet := UTXOSet{bc} UTXOSet.Reindex() diff --git a/cli_send.go b/cli_send.go index fea84d8..f9c45d6 100644 --- a/cli_send.go +++ b/cli_send.go @@ -13,7 +13,7 @@ func (cli *CLI) send(from, to string, amount int) { log.Panic("ERROR: Recipient address is not valid") } - bc := NewBlockchain(from) + bc := NewBlockchain() defer bc.db.Close() tx := NewUTXOTransaction(from, to, amount, bc)