Documentation ¶
Index ¶
- type MilestoneManager
- func (m *MilestoneManager) FindClosestNextMilestoneIndex(index iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
- func (m *MilestoneManager) KeyManager() *keymanager.KeyManager
- func (m *MilestoneManager) StoreMilestone(cachedBlock *storage.CachedBlock, milestonePayload *iotago.Milestone, ...)
- func (m *MilestoneManager) VerifyMilestoneBlock(block *iotago.Block) *iotago.Milestone
- func (m *MilestoneManager) VerifyMilestonePayload(payload iotago.Payload) *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) FindClosestNextMilestoneIndex ¶
func (m *MilestoneManager) FindClosestNextMilestoneIndex(index iotago.MilestoneIndex) (iotago.MilestoneIndex, error)
FindClosestNextMilestoneIndex searches for the next known milestone in the persistence layer.
func (*MilestoneManager) KeyManager ¶
func (m *MilestoneManager) KeyManager() *keymanager.KeyManager
KeyManager returns the used key manager.
func (*MilestoneManager) StoreMilestone ¶
func (m *MilestoneManager) StoreMilestone(cachedBlock *storage.CachedBlock, milestonePayload *iotago.Milestone, requested bool)
StoreMilestone stores the milestone in the storage layer and triggers the ReceivedValidMilestone event.
func (*MilestoneManager) VerifyMilestoneBlock ¶
func (m *MilestoneManager) VerifyMilestoneBlock(block *iotago.Block) *iotago.Milestone
VerifyMilestoneBlock checks if the block contains a valid milestone payload. Returns a milestone payload if the signature is valid.
func (*MilestoneManager) VerifyMilestonePayload ¶
func (m *MilestoneManager) VerifyMilestonePayload(payload iotago.Payload) *iotago.Milestone
VerifyMilestonePayload checks if milestone payload is valid. Attention: It does not check if the milestone payload parents match the block parents. Returns a milestone payload if the signature is valid.