core/txpool/blobpool: use nonce from argument instead of tx.Nonce()

This does not change the behavior here as the nonce in the argument is
tx.Nonce(). This commit helps to make the function easier to read and avoid
capturing the tx in the function.
This commit is contained in:
Bui Quang Minh 2024-07-12 13:26:21 +07:00
parent cf0378499f
commit e389598d44
No known key found for this signature in database
GPG key ID: DADFFFFF480828D6

View file

@ -1116,7 +1116,7 @@ func (p *BlobPool) validateTx(tx *types.Transaction) error {
ExistingCost: func(addr common.Address, nonce uint64) *big.Int { ExistingCost: func(addr common.Address, nonce uint64) *big.Int {
next := p.state.GetNonce(addr) next := p.state.GetNonce(addr)
if uint64(len(p.index[addr])) > nonce-next { if uint64(len(p.index[addr])) > nonce-next {
return p.index[addr][int(tx.Nonce()-next)].costCap.ToBig() return p.index[addr][int(nonce-next)].costCap.ToBig()
} }
return nil return nil
}, },