From 05e94ffee0340243d51e09f294f2e192da30aa33 Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Tue, 12 Sep 2023 16:54:02 +0800 Subject: [PATCH] miner: do not copy nil baseFee for transactionsByPriceAndNonce --- miner/ordering.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/miner/ordering.go b/miner/ordering.go index 98061e32e6..7e3640a455 100644 --- a/miner/ordering.go +++ b/miner/ordering.go @@ -126,11 +126,15 @@ func (t *transactionsByPriceAndNonce) Copy() *transactionsByPriceAndNonce { for acc, txsTmp := range t.txs { txs[acc] = txsTmp } + var baseFee *big.Int + if t.baseFee != nil { + baseFee = big.NewInt(0).Set(t.baseFee) + } return &transactionsByPriceAndNonce{ heads: heads, txs: txs, signer: t.signer, - baseFee: big.NewInt(0).Set(t.baseFee), + baseFee: baseFee, } }