aboutsummaryrefslogtreecommitdiffstats
path: root/miner
diff options
context:
space:
mode:
authorJim McDonald <Jim@mcdee.net>2018-01-15 18:57:06 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-15 18:57:06 +0800
commit18a7d313386194be39e733ac3043988690f42464 (patch)
treeb7aa8f4db37b3e007ae251ac36d579509f735451 /miner
parent938cf4528ab5acbb6013be79a0548956713807a8 (diff)
downloaddexon-18a7d313386194be39e733ac3043988690f42464.tar.gz
dexon-18a7d313386194be39e733ac3043988690f42464.tar.zst
dexon-18a7d313386194be39e733ac3043988690f42464.zip
miner: avoid unnecessary work (#15883)
Diffstat (limited to 'miner')
-rw-r--r--miner/worker.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/miner/worker.go b/miner/worker.go
index 638f759bf..1520277e1 100644
--- a/miner/worker.go
+++ b/miner/worker.go
@@ -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 {