Documentation ¶
Index ¶
- Variables
- func FindAllTails(startTxHash hornet.Hash, skipStartTx bool) (map[string]struct{}, error)
- func GetTransactionRootSnapshotIndexes(cachedTxMeta *tangle.CachedMetadata, 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 ApproveesTraverser
- type ApproversTraverser
- 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 ¶
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(cachedTxMeta *tangle.CachedMetadata, 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, 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, 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, walkAlreadyDiscovered 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 ApproveesTraverser ¶ added in v0.5.0
type ApproveesTraverser struct {
// contains filtered or unexported fields
}
func NewApproveesTraverser ¶ added in v0.5.0
func NewApproveesTraverser(condition Predicate, consumer Consumer, onMissingApprovee OnMissingApprovee, onSolidEntryPoint OnSolidEntryPoint, abortSignal <-chan struct{}) *ApproveesTraverser
NewApproveesTraverser create a new traverser to traverse the approvees (past cone)
func (*ApproveesTraverser) Traverse ¶ added in v0.5.0
func (t *ApproveesTraverser) Traverse(startTxHash hornet.Hash, traverseSolidEntryPoints bool, traverseTailsOnly bool) error
Traverse 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 (*ApproveesTraverser) TraverseTrunkAndBranch ¶ added in v0.5.0
func (t *ApproveesTraverser) TraverseTrunkAndBranch(trunkTxHash hornet.Hash, branchTxHash hornet.Hash, traverseSolidEntryPoints bool, traverseTailsOnly bool) error
TraverseTrunkAndBranch 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
type ApproversTraverser ¶ added in v0.5.0
type ApproversTraverser struct {
// contains filtered or unexported fields
}
func NewApproversTraverser ¶ added in v0.5.0
func NewApproversTraverser(condition Predicate, consumer Consumer, walkAlreadyDiscovered bool, abortSignal <-chan struct{}) *ApproversTraverser
NewApproversTraverser create a new traverser to traverse the approvers (future cone)
func (*ApproversTraverser) Traverse ¶ added in v0.5.0
func (t *ApproversTraverser) Traverse(startTxHash hornet.Hash) error
Traverse 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.
type Consumer ¶
type Consumer func(cachedTxMeta *tangle.CachedMetadata) error
Consumer consumes the given transaction metadata 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.