milestonemanager

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: 7 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

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