From ffd08b1afde0e426fd8544e050ef698a1cec76de Mon Sep 17 00:00:00 2001 From: zhangzhen Date: Thu, 21 Jun 2018 11:59:51 +0800 Subject: [PATCH] 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}