mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core/txpool: apply diff
This commit is contained in:
parent
ab137eafad
commit
239738be19
1 changed files with 3 additions and 2 deletions
|
|
@ -323,8 +323,6 @@ func (l *list) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Transa
|
||||||
if tx.GasFeeCapIntCmp(thresholdFeeCap) < 0 || tx.GasTipCapIntCmp(thresholdTip) < 0 {
|
if tx.GasFeeCapIntCmp(thresholdFeeCap) < 0 || tx.GasTipCapIntCmp(thresholdTip) < 0 {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
// Old is being replaced, subtract old cost
|
|
||||||
l.subTotalCost([]*types.Transaction{old})
|
|
||||||
}
|
}
|
||||||
// Add new tx cost to totalcost
|
// Add new tx cost to totalcost
|
||||||
cost, overflow := uint256.FromBig(tx.Cost())
|
cost, overflow := uint256.FromBig(tx.Cost())
|
||||||
|
|
@ -337,6 +335,9 @@ func (l *list) Add(tx *types.Transaction, priceBump uint64) (bool, *types.Transa
|
||||||
}
|
}
|
||||||
l.totalcost = total
|
l.totalcost = total
|
||||||
|
|
||||||
|
// Old is being replaced, subtract old cost
|
||||||
|
l.subTotalCost([]*types.Transaction{old})
|
||||||
|
|
||||||
// Otherwise overwrite the old transaction with the current one
|
// Otherwise overwrite the old transaction with the current one
|
||||||
l.txs.Put(tx)
|
l.txs.Put(tx)
|
||||||
if l.costcap.Cmp(cost) < 0 {
|
if l.costcap.Cmp(cost) < 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue