miner : fix exit channel goroutine leak

This commit is contained in:
ucwong 2020-04-03 08:26:25 +00:00
parent f7b29ec942
commit 071e15820d
2 changed files with 2 additions and 2 deletions

View file

@ -71,7 +71,7 @@ func New(eth Backend, config *Config, chainConfig *params.ChainConfig, mux *even
eth: eth,
mux: mux,
engine: engine,
exitCh: make(chan struct{}),
exitCh: make(chan struct{}, 1),
worker: newWorker(config, chainConfig, engine, eth, mux, isLocalBlock, true),
canStart: 1,
}

View file

@ -198,7 +198,7 @@ func newWorker(config *Config, chainConfig *params.ChainConfig, engine consensus
newWorkCh: make(chan *newWorkReq),
taskCh: make(chan *task),
resultCh: make(chan *types.Block, resultQueueSize),
exitCh: make(chan struct{}),
exitCh: make(chan struct{}, 1),
startCh: make(chan struct{}, 1),
resubmitIntervalCh: make(chan time.Duration),
resubmitAdjustCh: make(chan *intervalAdjust, resubmitAdjustChanSize),