mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
miner: don't update pending state when no transactions are added
This commit is contained in:
parent
96f8be36ad
commit
6fffb61bc1
1 changed files with 6 additions and 1 deletions
|
|
@ -463,8 +463,13 @@ func (w *worker) mainLoop() {
|
||||||
txs[acc] = append(txs[acc], tx)
|
txs[acc] = append(txs[acc], tx)
|
||||||
}
|
}
|
||||||
txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs)
|
txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs)
|
||||||
|
tcount := w.current.tcount
|
||||||
w.commitTransactions(txset, coinbase, nil)
|
w.commitTransactions(txset, coinbase, nil)
|
||||||
w.updateSnapshot()
|
// Only update the snapshot if any new transactons were added
|
||||||
|
// to the pending block
|
||||||
|
if tcount != w.current.tcount {
|
||||||
|
w.updateSnapshot()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// If clique is running in dev mode(period is 0), disable
|
// If clique is running in dev mode(period is 0), disable
|
||||||
// advance sealing here.
|
// advance sealing here.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue