From 481ca91e3485936bc062c85aaf965b51a1a032d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Tue, 28 Feb 2023 09:08:41 +0100 Subject: [PATCH] fix: do not produce empty blocks when all transactions fail (#235) --- miner/worker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index 2917d5af7c..524af36e6f 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1038,6 +1038,12 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) return } } + + // do not produce empty blocks + if w.current.tcount == 0 { + return + } + w.commit(uncles, w.fullTaskHook, true, tstart) }