Documentation ¶
Index ¶
- type SyncManager
- func (s *SyncManager) ConfirmedMilestoneIndex() milestone.Index
- func (s *SyncManager) IsNodeAlmostSynced() bool
- func (s *SyncManager) IsNodeSynced() bool
- func (s *SyncManager) IsNodeSyncedWithThreshold(threshold milestone.Index) bool
- func (s *SyncManager) IsNodeSyncedWithinBelowMaxDepth() bool
- func (s *SyncManager) LatestMilestoneIndex() milestone.Index
- func (s *SyncManager) OverwriteConfirmedMilestoneIndex(index milestone.Index)
- func (s *SyncManager) ResetMilestoneIndexes()
- func (s *SyncManager) SetConfirmedMilestoneIndex(index milestone.Index, updateSynced ...bool) error
- func (s *SyncManager) SetLatestMilestoneIndex(index milestone.Index, updateSynced ...bool) bool
- func (s *SyncManager) WaitForNodeSynced(timeout time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncManager ¶
type SyncManager struct {
// contains filtered or unexported fields
}
func (*SyncManager) ConfirmedMilestoneIndex ¶
func (s *SyncManager) ConfirmedMilestoneIndex() milestone.Index
ConfirmedMilestoneIndex returns the confirmed milestone index.
func (*SyncManager) IsNodeAlmostSynced ¶
func (s *SyncManager) IsNodeAlmostSynced() bool
IsNodeAlmostSynced returns whether the node is synced within "isNodeAlmostSyncedThreshold".
func (*SyncManager) IsNodeSynced ¶
func (s *SyncManager) IsNodeSynced() bool
IsNodeSynced returns whether the node is synced.
func (*SyncManager) IsNodeSyncedWithThreshold ¶
func (s *SyncManager) IsNodeSyncedWithThreshold(threshold milestone.Index) bool
IsNodeSyncedWithThreshold returns whether the node is synced within a given threshold.
func (*SyncManager) IsNodeSyncedWithinBelowMaxDepth ¶
func (s *SyncManager) IsNodeSyncedWithinBelowMaxDepth() bool
IsNodeSyncedWithinBelowMaxDepth returns whether the node is synced within "belowMaxDepth".
func (*SyncManager) LatestMilestoneIndex ¶
func (s *SyncManager) LatestMilestoneIndex() milestone.Index
LatestMilestoneIndex returns the latest milestone index.
func (*SyncManager) OverwriteConfirmedMilestoneIndex ¶
func (s *SyncManager) OverwriteConfirmedMilestoneIndex(index milestone.Index)
OverwriteConfirmedMilestoneIndex is used to set older confirmed milestones (revalidation).
func (*SyncManager) ResetMilestoneIndexes ¶
func (s *SyncManager) ResetMilestoneIndexes()
func (*SyncManager) SetConfirmedMilestoneIndex ¶
func (s *SyncManager) SetConfirmedMilestoneIndex(index milestone.Index, updateSynced ...bool) error
SetConfirmedMilestoneIndex sets the confirmed milestone index.
func (*SyncManager) SetLatestMilestoneIndex ¶
func (s *SyncManager) SetLatestMilestoneIndex(index milestone.Index, updateSynced ...bool) bool
SetLatestMilestoneIndex sets the latest milestone index.
func (*SyncManager) WaitForNodeSynced ¶
func (s *SyncManager) WaitForNodeSynced(timeout time.Duration) bool
WaitForNodeSynced waits at most "timeout" duration for the node to become fully sync. if it is not at least synced within threshold, it will return false immediately. this is used to avoid small glitches of IsNodeSynced when the sync state is important, but a new milestone came in lately.