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>
This commit is contained in:
parent
07b5a04bd6
commit
0dd7e82c0a
|
@ -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…
Reference in New Issue