tangle

package
v0.2.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRefBundleNotValid    = errors.New("a referenced bundle is invalid")
	ErrRefBundleNotComplete = errors.New("a referenced bundle is not complete")

	RefsAnInvalidBundleCache *datastructure.LRUCache
)
View Source
var BelowDepthMemoizationCache = belowDepthMemoizationCache{/* contains filtered or unexported fields */}

BelowDepthMemoizationCache caches hashes below a max depth

View Source
var Events = pluginEvents{
	ReceivedNewTransaction:        events.NewEvent(hornet.NewTransactionCaller),
	ReceivedKnownTransaction:      events.NewEvent(hornet.TransactionCaller),
	TransactionSolid:              events.NewEvent(hornet.TransactionCaller),
	TransactionConfirmed:          events.NewEvent(hornet.TransactionConfirmedCaller),
	TransactionStored:             events.NewEvent(hornet.TransactionCaller),
	ReceivedNewMilestone:          events.NewEvent(tangle.BundleCaller),
	LatestMilestoneChanged:        events.NewEvent(tangle.BundleCaller),
	SolidMilestoneChanged:         events.NewEvent(tangle.BundleCaller),
	SnapshotMilestoneIndexChanged: events.NewEvent(milestone_index.MilestoneIndexCaller),
}
View Source
var (
	PLUGIN = node.NewPlugin("Tangle", node.Enabled, configure, run)
)

Functions

func CheckConsistencyOfConeAndMutateDiff

func CheckConsistencyOfConeAndMutateDiff(tailTxHash trinary.Hash, approved map[trinary.Hash]struct{}, diff map[trinary.Hash]int64) bool

CheckConsistencyOfConeAndMutateDiff checks whether cone referenced by the given tail transaction is consistent with the current diff. this function mutates the approved, respectively walked transaction hashes and the diff with the cone diff, in case the tail transaction is consistent with the latest ledger state.

func GetSolidifierMilestoneIndex

func GetSolidifierMilestoneIndex() milestone_index.MilestoneIndex

func IsBelowMaxDepth

func IsBelowMaxDepth(tailTx *hornet.Transaction, lowerAllowedSnapshotIndex int) bool

IsBelowMaxDepth checks whether the given transaction is below the max depth by first checking whether it is confirmed within the range of allowed milestones. if not, it is checked whether any referenced (directly/indirectly) tx is confirmed by a milestone below the allowed threshold until a limit is reached of analyzed txs, in which case the given tail transaction is also deemed being below max depth.

Types

This section is empty.

Jump to

Keyboard shortcuts

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