From 8470b53d88d202948295dec28fda2d9340f00204 Mon Sep 17 00:00:00 2001 From: Jim McDonald Date: Mon, 30 Oct 2017 07:49:33 +0000 Subject: [PATCH] core: allow price bump at threshold --- core/tx_list.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/tx_list.go b/core/tx_list.go index 2935929d72..838433b897 100644 --- a/core/tx_list.go +++ b/core/tx_list.go @@ -254,7 +254,10 @@ func (l *txList) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Tran old := l.txs.Get(tx.Nonce()) if old != nil { threshold := new(big.Int).Div(new(big.Int).Mul(old.GasPrice(), big.NewInt(100+int64(priceBump))), big.NewInt(100)) - if threshold.Cmp(tx.GasPrice()) >= 0 { + // Have to ensure that the new gas price is higher than the old gas + // price as well as checking the percentage threshold to ensure that + // this is accurate for low (Wei-level) gas price replacements + if old.GasPrice().Cmp(tx.GasPrice()) >= 0 || threshold.Cmp(tx.GasPrice()) > 0 { return false, nil } }