From dbdd485a3acfe45898a92ae6f29f9e731bdda3d6 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 19 Jun 2019 10:34:00 +0200 Subject: [PATCH] miner: avoid transaction processing when pending block is already full --- miner/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index c4b5cbc625..4a9528c395 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -453,6 +453,10 @@ func (w *worker) mainLoop() { // already included in the current mining block. These transactions will // be automatically eliminated. if !w.isRunning() && w.current != nil { + // If block is already full, abort + if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas { + continue + } w.mu.RLock() coinbase := w.coinbase w.mu.RUnlock()