Skip to content

Commit

Permalink
fix panic in canonical.go
Browse files Browse the repository at this point in the history
  • Loading branch information
pk910 committed Nov 25, 2024
1 parent 8434199 commit 83a03b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion indexer/beacon/canonical.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ func (indexer *Indexer) GetCanonicalHead(overrideForkId *ForkKey) *Block {
factor = 0.5
}
percentagesI += chainHeadCandidates[i].PerEpochVotingPercent[k] * factor
percentagesJ += chainHeadCandidates[j].PerEpochVotingPercent[k] * factor
if len(chainHeadCandidates[j].PerEpochVotingPercent) > k {
percentagesJ += chainHeadCandidates[j].PerEpochVotingPercent[k] * factor
}
}

if percentagesI != percentagesJ {
Expand Down

0 comments on commit 83a03b9

Please sign in to comment.