Skip to content

Commit 0dd7e82

Browse files
mask-ppholiman
andauthored
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 <[email protected]>
1 parent 07b5a04 commit 0dd7e82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/txpool/blobpool/blobpool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ func (p *BlobPool) recheck(addr common.Address, inclusions map[common.Hash]uint6
566566
ids []uint64
567567
nonces []uint64
568568
)
569-
for txs[0].nonce < next {
569+
for len(txs) > 0 && txs[0].nonce < next {
570570
ids = append(ids, txs[0].id)
571571
nonces = append(nonces, txs[0].nonce)
572572

0 commit comments

Comments
 (0)