Skip to content

Commit

Permalink
Only update committee cache if it doesn't have that key already (#4719)
Browse files Browse the repository at this point in the history
* Only update committee cache if it doesn't have that key already
  • Loading branch information
prestonvanloon committed Feb 3, 2020
1 parent bd334c4 commit 05876d6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions beacon-chain/core/helpers/committee.go
Expand Up @@ -401,6 +401,9 @@ func UpdateCommitteeCache(state *stateTrie.BeaconState, epoch uint64) error {
if err != nil {
return err
}
if _, exists, err := committeeCache.CommitteeCache.GetByKey(string(seed[:])); err == nil && exists {
return nil
}

// Store the sorted indices as well as shuffled indices. In current spec,
// sorted indices is required to retrieve proposer index. This is also
Expand Down

0 comments on commit 05876d6

Please sign in to comment.