Skip to content

Commit

Permalink
Merge pull request #221 from ethpandaops/pk910/fix-panic-in-exec-hash…
Browse files Browse the repository at this point in the history
…-search

fix out of range panic in search handler
  • Loading branch information
pk910 authored Jan 22, 2025
2 parents dbc8579 + 1dd2259 commit ba1c437
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handlers/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ func SearchAhead(w http.ResponseWriter, r *http.Request) {

cachedBlocks := indexer.GetBlocksByExecutionBlockHash(phase0.Hash32(blockHash))
if len(cachedBlocks) > 0 {
res := make([]*models.SearchAheadExecBlocksResult, 0)
res := make([]*models.SearchAheadExecBlocksResult, len(cachedBlocks))
for idx, cachedBlock := range cachedBlocks {
header := cachedBlock.GetHeader()
index := cachedBlock.GetBlockIndex()
Expand Down

0 comments on commit ba1c437

Please sign in to comment.