Skip to content

Commit

Permalink
core/txpool/blobpool: avoid possible zero index panic (#30430) (#579)
Browse files Browse the repository at this point in the history
commit ethereum/go-ethereum@0dd7e82.

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

---------

Co-authored-by: maskpp <[email protected]>
Co-authored-by: Martin HS <[email protected]>
  • Loading branch information
3 people authored Sep 20, 2024
1 parent f2ae2f8 commit 75cad3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/txpool/blobpool/blobpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,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)

Expand Down

0 comments on commit 75cad3d

Please sign in to comment.