mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -05:00
Add Unsafe Sync (#4906)
* add unsafe flag * imports * Use finalized epoch Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com>
This commit is contained in:
@@ -26,6 +26,7 @@ type blockchainService interface {
|
||||
blockchain.BlockReceiver
|
||||
blockchain.HeadFetcher
|
||||
ClearCachedStates()
|
||||
blockchain.FinalizationFetcher
|
||||
}
|
||||
|
||||
const (
|
||||
@@ -178,7 +179,7 @@ func (s *Service) waitForMinimumPeers() {
|
||||
required = flags.Get().MinimumSyncPeers
|
||||
}
|
||||
for {
|
||||
_, _, peers := s.p2p.Peers().BestFinalized(params.BeaconConfig().MaxPeersToSync, helpers.SlotToEpoch(s.chain.HeadSlot()))
|
||||
_, _, peers := s.p2p.Peers().BestFinalized(params.BeaconConfig().MaxPeersToSync, s.chain.FinalizedCheckpt().Epoch)
|
||||
if len(peers) >= required {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user