From 4b7668d4d7579eecc15be65c9c7902ff7e3ad341 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Sat, 10 Apr 2021 14:45:13 -0700 Subject: [PATCH] Discard bundles with reverting txs Fixes #30 --- miner/worker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miner/worker.go b/miner/worker.go index bf9de255036c..9ad092f22a2b 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1286,6 +1286,10 @@ func (w *worker) computeBundleGas(bundle types.Transactions, parent *types.Block if err != nil { return nil, 0, err } + if receipt.Status == types.ReceiptStatusFailed { + return nil, 0, errors.New("revert") + } + totalGasUsed += receipt.GasUsed gasFees.Add(gasFees, new(big.Int).Mul(big.NewInt(int64(totalGasUsed)), tx.GasPrice())) }