pub struct IndexedTxGraph<A, I> {
    pub index: I,
    /* private fields */
}
Expand description

The IndexedTxGraph combines a TxGraph and an Indexer implementation.

It ensures that TxGraph and Indexer are updated atomically.

Fields§

§index: I

Transaction index.

Implementations§

Construct a new IndexedTxGraph with a given index.

Get a reference of the internal transaction graph.

Applies the ChangeSet to the IndexedTxGraph.

Determines the ChangeSet between self and an empty IndexedTxGraph.

Apply an update directly.

update is a TxGraph<A> and the resultant changes is returned as ChangeSet.

Insert a floating txout of given outpoint.

Insert and index a transaction into the graph.

Insert an anchor for a given transaction.

Insert a unix timestamp of when a transaction is seen in the mempool.

This is used for transaction conflict resolution in TxGraph where the transaction with the later last-seen is prioritized.

Batch insert transactions, filtering out those that are irrelevant.

Relevancy is determined by the Indexer::is_tx_relevant implementation of I. Irrelevant transactions in txs will be ignored. txs do not need to be in topological order.

Batch insert unconfirmed transactions, filtering out those that are irrelevant.

Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I. Irrelevant transactions in txs will be ignored.

Items of txs are tuples containing the transaction and a last seen timestamp. The last seen communicates when the transaction is last seen in the mempool which is used for conflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

Batch insert unconfirmed transactions.

Items of txs are tuples containing the transaction and a last seen timestamp. The last seen communicates when the transaction is last seen in the mempool which is used for conflict-resolution in TxGraph (refer to TxGraph::insert_seen_at for details).

To filter out irrelevant transactions, use batch_insert_relevant_unconfirmed instead.

Methods are available if the anchor (A) implements AnchorFromBlockPosition.

Batch insert all transactions of the given block of height, filtering out those that are irrelevant.

Each inserted transaction’s anchor will be constructed from AnchorFromBlockPosition::from_block_position.

Relevancy is determined by the internal Indexer::is_tx_relevant implementation of I. Irrelevant transactions in txs will be ignored.

Batch insert all transactions of the given block of height.

Each inserted transaction’s anchor will be constructed from AnchorFromBlockPosition::from_block_position.

To only insert relevant transactions, use apply_block_relevant instead.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.