mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
miner: minor fix for the interrupt memory allocation
if the interrupt pointer is NULL then allocate memory for it. if the intterupt point is not NULL then reuse original one.
This commit is contained in:
parent
25c3282cf1
commit
fd5e32a458
1 changed files with 2 additions and 1 deletions
|
|
@ -299,8 +299,9 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
|
|||
commit := func(noempty bool, s int32) {
|
||||
if interrupt != nil {
|
||||
atomic.StoreInt32(interrupt, s)
|
||||
}
|
||||
} else {
|
||||
interrupt = new(int32)
|
||||
}
|
||||
w.newWorkCh <- &newWorkReq{interrupt: interrupt, noempty: noempty, timestamp: timestamp}
|
||||
timer.Reset(recommit)
|
||||
atomic.StoreInt32(&w.newTxs, 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue