mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
remove miner dumlicated pendingMutex
This commit is contained in:
parent
06883c1686
commit
fb2dc25f64
1 changed files with 0 additions and 3 deletions
|
|
@ -72,7 +72,6 @@ type Miner struct {
|
||||||
txpool *txpool.TxPool
|
txpool *txpool.TxPool
|
||||||
chain *core.BlockChain
|
chain *core.BlockChain
|
||||||
pending *pending
|
pending *pending
|
||||||
pendingMu sync.Mutex // Lock protects the pending block
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new miner with provided config.
|
// New creates a new miner with provided config.
|
||||||
|
|
@ -134,8 +133,6 @@ func (miner *Miner) BuildPayload(args *BuildPayloadArgs, witness bool) (*Payload
|
||||||
// The result might be nil if pending generation is failed.
|
// The result might be nil if pending generation is failed.
|
||||||
func (miner *Miner) getPending() *newPayloadResult {
|
func (miner *Miner) getPending() *newPayloadResult {
|
||||||
header := miner.chain.CurrentHeader()
|
header := miner.chain.CurrentHeader()
|
||||||
miner.pendingMu.Lock()
|
|
||||||
defer miner.pendingMu.Unlock()
|
|
||||||
if cached := miner.pending.resolve(header.Hash()); cached != nil {
|
if cached := miner.pending.resolve(header.Hash()); cached != nil {
|
||||||
return cached
|
return cached
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue