mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-31 23:25:54 +00:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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 a new issue