Use helper to calculate epoch (#4497)

This commit is contained in:
Jim McDonald
2020-01-11 11:06:10 +00:00
committed by Nishant Das
parent 4e6c8c5b1a
commit 3c5d5bfc7b
3 changed files with 6 additions and 6 deletions

View File

@@ -168,7 +168,7 @@ func (s *Service) waitForMinimumPeers() {
required = flags.Get().MinimumSyncPeers
}
for {
_, _, peers := s.p2p.Peers().BestFinalized(params.BeaconConfig().MaxPeersToSync, s.chain.HeadSlot()/params.BeaconConfig().SlotsPerEpoch)
_, _, peers := s.p2p.Peers().BestFinalized(params.BeaconConfig().MaxPeersToSync, helpers.SlotToEpoch(s.chain.HeadSlot()))
if len(peers) >= required {
break
}