eth, miner: prefer locally generated uncles vs remote ones (#17715)
* core, eth: fix dependency cycle * eth, miner: perfer to locally generated uncle
This commit is contained in:
committed by
Péter Szilágyi
parent
ba0a8b7887
commit
457e930f27
@ -52,13 +52,13 @@ type Miner struct {
|
||||
shouldStart int32 // should start indicates whether we should start after sync
|
||||
}
|
||||
|
||||
func New(eth Backend, config *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, recommit time.Duration, gasFloor, gasCeil uint64) *Miner {
|
||||
func New(eth Backend, config *params.ChainConfig, mux *event.TypeMux, engine consensus.Engine, recommit time.Duration, gasFloor, gasCeil uint64, isLocalBlock func(block *types.Block) bool) *Miner {
|
||||
miner := &Miner{
|
||||
eth: eth,
|
||||
mux: mux,
|
||||
engine: engine,
|
||||
exitCh: make(chan struct{}),
|
||||
worker: newWorker(config, engine, eth, mux, recommit, gasFloor, gasCeil),
|
||||
worker: newWorker(config, engine, eth, mux, recommit, gasFloor, gasCeil, isLocalBlock),
|
||||
canStart: 1,
|
||||
}
|
||||
go miner.update()
|
||||
|
Reference in New Issue
Block a user