Documentation ¶
Index ¶
- Variables
- func FindAllTails(startTxHash hornet.Hash, skipStartTx bool, forceRelease bool) (map[string]struct{}, error)
- func GetTransactionRootSnapshotIndexes(cachedTx *tangle.CachedTransaction, lsmi milestone.Index) (youngestTxRootSnapshotIndex milestone.Index, ...)
- func TraverseApprovees(startTxHash hornet.Hash, condition Predicate, consumer Consumer, ...) error
- func TraverseApproveesTrunkBranch(trunkTxHash hornet.Hash, branchTxHash hornet.Hash, condition Predicate, ...) error
- func TraverseApprovers(startTxHash hornet.Hash, condition Predicate, consumer Consumer, ...) error
- func UpdateOutdatedRootSnapshotIndexes(outdatedTransactions hornet.Hashes, lsmi milestone.Index)
- func UpdateTransactionRootSnapshotIndexes(txHashes hornet.Hashes, lsmi milestone.Index)
- type Consumer
- type OnMissingApprovee
- type OnSolidEntryPoint
- type Predicate
Constants ¶
This section is empty.
Variables ¶
var (
ErrFindAllTailsFailed = errors.New("Unable to find all tails")
)
Functions ¶
func FindAllTails ¶
func FindAllTails(startTxHash hornet.Hash, skipStartTx bool, forceRelease bool) (map[string]struct{}, error)
FindAllTails searches all tail transactions the given startTxHash references. If skipStartTx is true, the startTxHash will be ignored and traversed, even if it is a tail transaction.
func GetTransactionRootSnapshotIndexes ¶ added in v0.5.0
func GetTransactionRootSnapshotIndexes(cachedTx *tangle.CachedTransaction, lsmi milestone.Index) (youngestTxRootSnapshotIndex milestone.Index, oldestTxRootSnapshotIndex milestone.Index)
GetTransactionRootSnapshotIndexes searches the transaction root snapshot indexes for a given transaction.
func TraverseApprovees ¶
func TraverseApprovees(startTxHash hornet.Hash, condition Predicate, consumer Consumer, onMissingApprovee OnMissingApprovee, onSolidEntryPoint OnSolidEntryPoint, forceRelease bool, traverseSolidEntryPoints bool, traverseTailsOnly bool, abortSignal <-chan struct{}) error
TraverseApprovees starts to traverse the approvees (past cone) of the given start transaction until the traversal stops due to no more transactions passing the given condition. It is a DFS with trunk / branch. Caution: condition func is not in DFS order
func TraverseApproveesTrunkBranch ¶ added in v0.5.0
func TraverseApproveesTrunkBranch(trunkTxHash hornet.Hash, branchTxHash hornet.Hash, condition Predicate, consumer Consumer, onMissingApprovee OnMissingApprovee, onSolidEntryPoint OnSolidEntryPoint, forceRelease bool, traverseSolidEntryPoints bool, traverseTailsOnly bool, abortSignal <-chan struct{}) error
TraverseApproveesTrunkBranch starts to traverse the approvees (past cone) of the given trunk transaction until the traversal stops due to no more transactions passing the given condition. Afterwards it traverses the approvees (past cone) of the given branch transaction. It is a DFS with trunk / branch. Caution: condition func is not in DFS order
func TraverseApprovers ¶ added in v0.5.0
func TraverseApprovers(startTxHash hornet.Hash, condition Predicate, consumer Consumer, forceRelease bool, abortSignal <-chan struct{}) error
TraverseApprovers starts to traverse the approvers (future cone) of the given start transaction until the traversal stops due to no more transactions passing the given condition. It is unsorted BFS because the approvers are not ordered in the database.
func UpdateOutdatedRootSnapshotIndexes ¶ added in v0.5.0
UpdateOutdatedRootSnapshotIndexes updates the transaction root snapshot indexes of the given transactions. the "outdatedTransactions" should be ordered from oldest to latest to avoid recursion.
func UpdateTransactionRootSnapshotIndexes ¶ added in v0.5.0
UpdateTransactionRootSnapshotIndexes updates the transaction root snapshot indexes of the future cone of all given transactions. all the transactions of the newly confirmed cone already have updated transaction root snapshot indexes. we have to walk the future cone, and update the past cone of all transactions that reference an old cone. as a special property, invocations of the yielded function share the same 'already traversed' set to circumvent walking the future cone of the same transactions multiple times.
Types ¶
type Consumer ¶
type Consumer func(cachedTx *tangle.CachedTransaction) error
Consumer consumes the given transaction during traversal.
type OnMissingApprovee ¶
OnMissingApprovee gets called when during traversal an approvee is missing.
type OnSolidEntryPoint ¶ added in v0.4.1
OnSolidEntryPoint gets called when during traversal the startTx or approvee is a solid entry point.