aboutsummaryrefslogtreecommitdiffstats
path: root/miner/miner.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2018-09-21 05:11:55 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-21 05:11:55 +0800
commit457e930f27242381db5b5fe185c30bed9a5f2f89 (patch)
tree3be747f0aef76b6d3c5dbd009cc9cecf09c79d25 /miner/miner.go
parentba0a8b7887cbaea861dca3f1408e59b88c174815 (diff)
downloaddexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar.gz
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar.bz2
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar.lz
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar.xz
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.tar.zst
dexon-457e930f27242381db5b5fe185c30bed9a5f2f89.zip
eth, miner: prefer locally generated uncles vs remote ones (#17715)
* core, eth: fix dependency cycle * eth, miner: perfer to locally generated uncle
Diffstat (limited to 'miner/miner.go')
-rw-r--r--miner/miner.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/miner/miner.go b/miner/miner.go
index 7f194db26..5218c1210 100644
--- a/miner/miner.go
+++ b/miner/miner.go
@@ -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()