tipselection

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDepthTooHigh = errors.New("depth is too high")
View Source
var ErrMilestoneNotFound = errors.New("milestone not found")
View Source
var ErrNodeNotSynced = errors.New("node is not synchronized")
View Source
var ErrReferenceNotConsistent = errors.New("reference transaction is not consistent")
View Source
var ErrReferenceNotValid = errors.New("reference transaction is not valid")
View Source
var Events = tipselevents{
	TipSelPerformed: events.NewEvent(WalkerStatsCaller),
}
View Source
var PLUGIN = node.NewPlugin("Tip-Sel", node.Enabled, configure, run)

Functions

func WalkerStatsCaller

func WalkerStatsCaller(handler interface{}, params ...interface{})

Types

type TipSelStats

type TipSelStats struct {
	// The duration of the tip-selection for both walks.
	Duration time.Duration `json:"duration"`
	// The entry point of the tip-selection.
	EntryPoint trinary.Hash `json:"entry_point"`
	// The optional supplied reference transaction hash.
	Reference *trinary.Hash `json:"reference"`
	// The used depth for the tip-selection.
	Depth uint64 `json:"depth"`
	// The amount of steps taken, respectively transactions walked towards the present of the graph.
	StepsTaken uint64 `json:"steps_taken"`
	// The amount of steps jumped, meaning approvers selected without validating, as they were
	// walked/validated into by the previous walk.
	StepsJumped uint64 `json:"steps_jumped"`
	// The amount of transactions which were evaluated.
	Evaluated uint64 `json:"evaluated"`
	// Represents the cache hit ration for every call to belowMaxDepth globally over all tip-selections.
	GlobalBelowMaxDepthCacheHitRatio float64 `json:"global_below_max_depth_cache_hit_ratio"`
}

func SelectTips

func SelectTips(depth uint, reference *trinary.Hash) ([]trinary.Hash, *TipSelStats, error)

Jump to

Keyboard shortcuts

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