miner: don't update pending state when no transactions are added

This commit is contained in:
Martin Holst Swende 2019-06-18 13:55:35 +02:00
parent 96f8be36ad
commit 6fffb61bc1
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -463,8 +463,13 @@ func (w *worker) mainLoop() {
txs[acc] = append(txs[acc], tx)
}
txset := types.NewTransactionsByPriceAndNonce(w.current.signer, txs)
tcount := w.current.tcount
w.commitTransactions(txset, coinbase, nil)
// Only update the snapshot if any new transactons were added
// to the pending block
if tcount != w.current.tcount {
w.updateSnapshot()
}
} else {
// If clique is running in dev mode(period is 0), disable
// advance sealing here.