OSDN Git Service

fix validate coinbase
authorshenao78 <shenao.78@163.com>
Thu, 31 Oct 2019 03:23:28 +0000 (11:23 +0800)
committershenao78 <shenao.78@163.com>
Thu, 31 Oct 2019 03:23:28 +0000 (11:23 +0800)
proposal/proposal.go

index e27e7a6..6a8264a 100644 (file)
@@ -147,7 +147,7 @@ func applyCoinbaseTransaction(chain *protocol.Chain, block *types.Block, txStatu
                return 0, errors.Wrap(err, "fail on create coinbase tx")
        }
 
-       gasState, err := validation.ValidateTx(coinbaseTx.Tx, &bc.Block{BlockHeader: &bc.BlockHeader{Height: chain.BestBlockHeight() + 1}})
+       gasState, err := validation.ValidateTx(coinbaseTx.Tx, &bc.Block{BlockHeader: &bc.BlockHeader{Height: chain.BestBlockHeight() + 1}, Transactions: []*bc.Tx{coinbaseTx.Tx}})
        if err != nil {
                return 0, err
        }