Skip to content

Commit

Permalink
copy just the pointer in the votes loop (#14196)
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz authored Jul 8, 2024
1 parent ae5b0b4 commit 3185619
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beacon-chain/forkchoice/doubly-linked-tree/forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,12 @@ func (f *ForkChoice) updateBalances() error {
newBalances := f.justifiedBalances
zHash := params.BeaconConfig().ZeroHash

for index, vote := range f.votes {
for index := 0; index < len(f.votes); index++ {
// Skip if validator has been slashed
if f.store.slashedIndices[primitives.ValidatorIndex(index)] {
continue
}
vote := &f.votes[index]
// Skip if validator has never voted for current root and next root (i.e. if the
// votes are zero hash aka genesis block), there's nothing to compute.
if vote.currentRoot == zHash && vote.nextRoot == zHash {
Expand Down

0 comments on commit 3185619

Please sign in to comment.