mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
simplify blobpool
This commit is contained in:
parent
8dd296201d
commit
d5636a0ca7
1 changed files with 6 additions and 14 deletions
|
|
@ -1030,23 +1030,15 @@ func (p *BlobPool) SetGasTip(tip *big.Int) {
|
|||
if tx.execTipCap.Cmp(p.gasTip) < 0 {
|
||||
// Drop the offending transaction
|
||||
var (
|
||||
ids = []uint64{tx.id}
|
||||
nonces = []uint64{tx.nonce}
|
||||
dropTxs = txs[i:]
|
||||
ids = make([]uint64, len(dropTxs))
|
||||
nonces = make([]uint64, len(dropTxs))
|
||||
)
|
||||
p.spent[addr] = new(uint256.Int).Sub(p.spent[addr], txs[i].costCap)
|
||||
p.stored -= uint64(tx.size)
|
||||
delete(p.lookup, tx.hash)
|
||||
txs[i] = nil
|
||||
|
||||
// Drop everything afterwards, no gaps allowed
|
||||
for j, tx := range txs[i+1:] {
|
||||
ids = append(ids, tx.id)
|
||||
nonces = append(nonces, tx.nonce)
|
||||
|
||||
p.spent[addr] = new(uint256.Int).Sub(p.spent[addr], tx.costCap)
|
||||
for j, tx := range dropTxs {
|
||||
p.spent[addr] = new(uint256.Int).Sub(p.spent[addr], txs[i].costCap)
|
||||
p.stored -= uint64(tx.size)
|
||||
delete(p.lookup, tx.hash)
|
||||
txs[i+1+j] = nil
|
||||
ids[j], nonces[j] = tx.id, tx.nonce
|
||||
}
|
||||
// Clear out the dropped transactions from the index
|
||||
if i > 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue