miner: avoid unnecessary work (#15883)

This commit is contained in:
Jim McDonald
2018-01-15 10:57:06 +00:00
committed by Péter Szilágyi
parent 938cf4528a
commit 18a7d31338
2 changed files with 10 additions and 0 deletions

View File

@ -512,6 +512,11 @@ func (env *Work) commitTransactions(mux *event.TypeMux, txs *types.TransactionsB
var coalescedLogs []*types.Log
for {
// If we don't have enough gas for any further transactions then we're done
if gp.Gas() < params.TxGas {
log.Trace("Not enough gas for further transactions", "gp", gp)
break
}
// Retrieve the next transaction and abort if all done
tx := txs.Peek()
if tx == nil {