mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
miner: explicitly assert consensus engine type
This commit is contained in:
parent
b65f3b5b4e
commit
b1a23a3751
1 changed files with 3 additions and 2 deletions
|
|
@ -594,12 +594,13 @@ func (w *worker) mainLoop() {
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
bor, _ := w.engine.(*bor.Bor)
|
bor, isBor := w.engine.(*bor.Bor)
|
||||||
|
devFakeAuthor := isBor && bor != nil && bor.DevFakeAuthor
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case req := <-w.newWorkCh:
|
case req := <-w.newWorkCh:
|
||||||
if w.chainConfig.ChainID.Cmp(params.BorMainnetChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.MumbaiChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.AmoyChainConfig.ChainID) == 0 {
|
if w.chainConfig.ChainID.Cmp(params.BorMainnetChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.MumbaiChainConfig.ChainID) == 0 || w.chainConfig.ChainID.Cmp(params.AmoyChainConfig.ChainID) == 0 {
|
||||||
if w.eth.PeerCount() > 0 || bor.DevFakeAuthor {
|
if w.eth.PeerCount() > 0 || devFakeAuthor {
|
||||||
//nolint:contextcheck
|
//nolint:contextcheck
|
||||||
w.commitWork(req.interrupt, req.noempty, req.timestamp)
|
w.commitWork(req.interrupt, req.noempty, req.timestamp)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue