Documentation ¶
Index ¶
- type MilestoneManager
- func (m *MilestoneManager) FindClosestNextMilestoneOrNil(index milestone.Index) *storage.CachedMilestone
- func (m *MilestoneManager) KeyManager() *keymanager.KeyManager
- func (m *MilestoneManager) StoreMilestone(cachedMsg *storage.CachedMessage, ms *iotago.Milestone, requested bool)
- func (m *MilestoneManager) VerifyMilestone(message *storage.Message) *iotago.Milestone
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MilestoneManager ¶
type MilestoneManager struct { // events Events *packageEvents // contains filtered or unexported fields }
MilestoneManager is used to retrieve, verify and store milestones.
func New ¶
func New( dbStorage *storage.Storage, syncManager *syncmanager.SyncManager, keyManager *keymanager.KeyManager, milestonePublicKeyCount int) *MilestoneManager
func (*MilestoneManager) FindClosestNextMilestoneOrNil ¶
func (m *MilestoneManager) FindClosestNextMilestoneOrNil(index milestone.Index) *storage.CachedMilestone
FindClosestNextMilestoneOrNil searches for the next known cached milestone in the persistence layer. milestone +1
func (*MilestoneManager) KeyManager ¶
func (m *MilestoneManager) KeyManager() *keymanager.KeyManager
KeyManager returns the used key manager.
func (*MilestoneManager) StoreMilestone ¶
func (m *MilestoneManager) StoreMilestone(cachedMsg *storage.CachedMessage, ms *iotago.Milestone, requested bool)
StoreMilestone stores the milestone in the storage layer and triggers the ReceivedValidMilestone event.
func (*MilestoneManager) VerifyMilestone ¶
func (m *MilestoneManager) VerifyMilestone(message *storage.Message) *iotago.Milestone
VerifyMilestone checks if the message contains a valid milestone payload. Returns a milestone payload if the signature is valid.
Click to show internal directories.
Click to hide internal directories.