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 {
|
if tx.execTipCap.Cmp(p.gasTip) < 0 {
|
||||||
// Drop the offending transaction
|
// Drop the offending transaction
|
||||||
var (
|
var (
|
||||||
ids = []uint64{tx.id}
|
dropTxs = txs[i:]
|
||||||
nonces = []uint64{tx.nonce}
|
ids = make([]uint64, len(dropTxs))
|
||||||
|
nonces = make([]uint64, len(dropTxs))
|
||||||
)
|
)
|
||||||
|
for j, tx := range dropTxs {
|
||||||
p.spent[addr] = new(uint256.Int).Sub(p.spent[addr], txs[i].costCap)
|
p.spent[addr] = new(uint256.Int).Sub(p.spent[addr], txs[i].costCap)
|
||||||
p.stored -= uint64(tx.size)
|
p.stored -= uint64(tx.size)
|
||||||
delete(p.lookup, tx.hash)
|
delete(p.lookup, tx.hash)
|
||||||
txs[i] = nil
|
ids[j], nonces[j] = tx.id, tx.nonce
|
||||||
|
|
||||||
// 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)
|
|
||||||
p.stored -= uint64(tx.size)
|
|
||||||
delete(p.lookup, tx.hash)
|
|
||||||
txs[i+1+j] = nil
|
|
||||||
}
|
}
|
||||||
// Clear out the dropped transactions from the index
|
// Clear out the dropped transactions from the index
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue