diff --git a/cli.go b/cli.go index b597b4c..ae43776 100644 --- a/cli.go +++ b/cli.go @@ -39,6 +39,7 @@ func (cli *CLI) Run() { fmt.Printf("NODE_ID env. var is not set!") os.Exit(1) } + nodeAddress = fmt.Sprintf("localhost:%s", nodeID) getBalanceCmd := flag.NewFlagSet("getbalance", flag.ExitOnError) createBlockchainCmd := flag.NewFlagSet("createblockchain", flag.ExitOnError) diff --git a/server.go b/server.go index b13f520..eef6c45 100644 --- a/server.go +++ b/server.go @@ -318,7 +318,7 @@ func handleTx(request []byte, bc *Blockchain) { } } } else { - if len(mempool) >= 2 && len(miningAddress) > 0 { + if len(mempool) >= 1 && len(miningAddress) > 0 { MineTransactions: var txs []*Transaction