diff --git a/miner/miner.go b/miner/miner.go index 0aeb2f0374..430efcb2fc 100644 --- a/miner/miner.go +++ b/miner/miner.go @@ -65,7 +65,7 @@ var DefaultConfig = Config{ // Miner is the main object which takes care of submitting new work to consensus // engine and gathering the sealing result. type Miner struct { - confMu sync.RWMutex // The lock used to protect the config + confMu sync.RWMutex // The lock used to protect the config fields: GasCeil, GasTip and Extradata config *Config chainConfig *params.ChainConfig engine consensus.Engine @@ -133,14 +133,10 @@ func (miner *Miner) BuildPayload(args *BuildPayloadArgs) (*Payload, error) { // getPending retrieves the pending block based on the current head block. // The result might be nil if pending generation is failed. func (miner *Miner) getPending() *newPayloadResult { - miner.confMu.RLock() - coinbase := miner.config.PendingFeeRecipient - miner.confMu.RUnlock() - header := miner.chain.CurrentHeader() miner.pendingMu.Lock() defer miner.pendingMu.Unlock() - if cached := miner.pending.resolve(header.Hash(), coinbase); cached != nil { + if cached := miner.pending.resolve(header.Hash()); cached != nil { return cached } @@ -155,7 +151,7 @@ func (miner *Miner) getPending() *newPayloadResult { timestamp: timestamp, forceTime: false, parentHash: header.Hash(), - coinbase: coinbase, + coinbase: miner.config.PendingFeeRecipient, random: common.Hash{}, withdrawals: withdrawal, beaconRoot: nil, diff --git a/miner/pending.go b/miner/pending.go index 2b09e07e0c..bb91fe8969 100644 --- a/miner/pending.go +++ b/miner/pending.go @@ -37,10 +37,10 @@ type pending struct { } // resolve retrieves the cached pending result if it's available. Nothing will be -// returned if the parentHash/coinbase is not matched or the result is already too old. +// returned if the parentHash is not matched or the result is already too old. // // Note, don't modify the returned payload result. -func (p *pending) resolve(parentHash common.Hash, coinbase common.Address) *newPayloadResult { +func (p *pending) resolve(parentHash common.Hash) *newPayloadResult { p.lock.Lock() defer p.lock.Unlock() @@ -50,9 +50,6 @@ func (p *pending) resolve(parentHash common.Hash, coinbase common.Address) *newP if parentHash != p.parentHash { return nil } - if p.result.block.Coinbase() != coinbase { - return nil - } if time.Since(p.created) > pendingTTL { return nil }