syncmanager

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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 New

func New(utxoManager *utxo.Manager, belowMaxDepth int) (*SyncManager, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL