core/txpool/blobpool: avoid possible zero index panic (#30430)

This situation(`len(txs) == 0`) rarely occurs, but if it does, it will
panic.

---------

Co-authored-by: Martin HS <martin@swende.se>
pull/30437/head^2
maskpp 2 months ago committed by GitHub
parent 07b5a04bd6
commit 0dd7e82c0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      core/txpool/blobpool/blobpool.go

@ -566,7 +566,7 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6
ids []uint64
nonces []uint64
)
for txs[0].nonce < next {
for len(txs) > 0 && txs[0].nonce < next {
ids = append(ids, txs[0].id)
nonces = append(nonces, txs[0].nonce)

Loading…
Cancel
Save