From 9fb848a2859f35856a65618a6ec76c90cae81dd8 Mon Sep 17 00:00:00 2001 From: irrun Date: Mon, 24 Jun 2024 14:45:21 +0800 Subject: [PATCH 1/2] fix: nil pointer when clear simulating bid --- miner/bid_simulator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index e80dc90b13..fa0cd0e9a8 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -420,7 +420,9 @@ func (b *bidSimulator) clearLoop() { b.simBidMu.Lock() if bid, ok := b.simulatingBid[parentHash]; ok { - bid.env.discard() + if bid.env != nil { + bid.env.discard() + } } delete(b.simulatingBid, parentHash) for k, v := range b.simulatingBid { From d01c0b38c0f1313dd215b5eddf82a2c367cd6746 Mon Sep 17 00:00:00 2001 From: irrun Date: Mon, 24 Jun 2024 15:44:30 +0800 Subject: [PATCH 2/2] fix: nil pointer when clear simulating bid --- miner/bid_simulator.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index fa0cd0e9a8..1d77308fed 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -419,12 +419,6 @@ func (b *bidSimulator) clearLoop() { b.bestBidMu.Unlock() b.simBidMu.Lock() - if bid, ok := b.simulatingBid[parentHash]; ok { - if bid.env != nil { - bid.env.discard() - } - } - delete(b.simulatingBid, parentHash) for k, v := range b.simulatingBid { if v.bid.BlockNumber <= blockNumber-core.TriesInMemory { v.env.discard()