Skip to content

Commit

Permalink
fix: fix potential index out of range risk
Browse files Browse the repository at this point in the history
  • Loading branch information
Lredhdx committed Dec 23, 2024
1 parent 6bbc128 commit 7012e8a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/txpool/bundlepool/bundlepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (p *BundlePool) reset(newHead *types.Header) {
(bundle.MaxBlockNumber != 0 && newHead.Number.Cmp(new(big.Int).SetUint64(bundle.MaxBlockNumber)) > 0) {
p.slots -= numSlots(p.bundles[hash])
delete(p.bundles, hash)
} else if txSet.Contains(bundle.Txs[0].Hash()) {
} else if len(bundle.Txs) == 0 || txSet.Contains(bundle.Txs[0].Hash()) {
p.slots -= numSlots(p.bundles[hash])
delete(p.bundles, hash)
}
Expand Down

0 comments on commit 7012e8a

Please sign in to comment.