From ffd08b1afde0e426fd8544e050ef698a1cec76de Mon Sep 17 00:00:00 2001 From: zhangzhen Date: Thu, 21 Jun 2018 11:59:51 +0800 Subject: [PATCH 1/2] coinbase first --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index b13f520..ca5657c 100644 --- a/server.go +++ b/server.go @@ -335,7 +335,7 @@ func handleTx(request []byte, bc *Blockchain) { } cbTx := NewCoinbaseTX(miningAddress, "") - txs = append(txs, cbTx) + txs = append([]*block.Transaction{cbTx}, txs...) newBlock := bc.MineBlock(txs) UTXOSet := UTXOSet{bc} From af63a875f5a66ae88e18ad3fd5ff343e0b2dcdbb Mon Sep 17 00:00:00 2001 From: Zane Date: Thu, 21 Jun 2018 12:49:21 +0800 Subject: [PATCH 2/2] coinbase first --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index ca5657c..a320644 100644 --- a/server.go +++ b/server.go @@ -335,7 +335,7 @@ func handleTx(request []byte, bc *Blockchain) { } cbTx := NewCoinbaseTX(miningAddress, "") - txs = append([]*block.Transaction{cbTx}, txs...) + txs = append([]*Transaction{cbTx}, txs...) newBlock := bc.MineBlock(txs) UTXOSet := UTXOSet{bc}