Remove the 'address' argument from NewBlockchain, since it's not used anymore
This commit is contained in:
parent
7eda539141
commit
cb78220abb
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func (cli *CLI) printChain() {
|
||||
bc := NewBlockchain("")
|
||||
bc := NewBlockchain()
|
||||
defer bc.db.Close()
|
||||
|
||||
bci := bc.Iterator()
|
||||
|
|
|
@ -3,7 +3,7 @@ package main
|
|||
import "fmt"
|
||||
|
||||
func (cli *CLI) reindexUTXO() {
|
||||
bc := NewBlockchain("")
|
||||
bc := NewBlockchain()
|
||||
UTXOSet := UTXOSet{bc}
|
||||
UTXOSet.Reindex()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue