This commit is contained in:
Dean 2023-06-14 22:08:35 +08:00 committed by GitHub
commit 6e6927e06c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

1
cli.go
View File

@ -39,6 +39,7 @@ func (cli *CLI) Run() {
fmt.Printf("NODE_ID env. var is not set!") fmt.Printf("NODE_ID env. var is not set!")
os.Exit(1) os.Exit(1)
} }
nodeAddress = fmt.Sprintf("localhost:%s", nodeID)
getBalanceCmd := flag.NewFlagSet("getbalance", flag.ExitOnError) getBalanceCmd := flag.NewFlagSet("getbalance", flag.ExitOnError)
createBlockchainCmd := flag.NewFlagSet("createblockchain", flag.ExitOnError) createBlockchainCmd := flag.NewFlagSet("createblockchain", flag.ExitOnError)

View File

@ -318,7 +318,7 @@ func handleTx(request []byte, bc *Blockchain) {
} }
} }
} else { } else {
if len(mempool) >= 2 && len(miningAddress) > 0 { if len(mempool) >= 1 && len(miningAddress) > 0 {
MineTransactions: MineTransactions:
var txs []*Transaction var txs []*Transaction