Skip to content

Commit

Permalink
active indices
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Oct 8, 2020
1 parent 2863f9c commit 6e8385f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions beacon-chain/cache/committee.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (c *CommitteeCache) ActiveIndices(seed [32]byte) ([]uint64, error) {
}

// ActiveIndicesCount returns the active indices count of a given seed stored in cache.
func (c *CommitteeCache) ActiveIndicesCount(seed [32]byte) (int, error) {
func (c *CommitteeCache) ActiveIndicesCount(seed [32]byte) (uint64, error) {
c.lock.RLock()
defer c.lock.RUnlock()
obj, exists, err := c.CommitteeCache.GetByKey(key(seed))
Expand All @@ -149,7 +149,7 @@ func (c *CommitteeCache) ActiveIndicesCount(seed [32]byte) (int, error) {
return 0, ErrNotCommittee
}

return len(item.SortedIndices), nil
return uint64(len(item.SortedIndices)), nil
}

// HasEntry returns true if the committee cache has a value.
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/core/helpers/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func ActiveValidatorCount(state *stateTrie.BeaconState, epoch uint64) (uint64, e
return 0, errors.Wrap(err, "could not interface with committee cache")
}
if activeCount != 0 && state.Slot() != 0 {
return uint64(activeCount), nil
return activeCount, nil
}

count := uint64(0)
Expand Down

0 comments on commit 6e8385f

Please sign in to comment.