23
23
//!
24
24
//! * [`list_canonical_txs`](TxGraph::list_canonical_txs) lists canonical transactions.
25
25
//! * [`filter_chain_txouts`](TxGraph::filter_chain_txouts) filters out canonical outputs from a
26
- //! list of outpoints.
26
+ //! list of outpoints.
27
27
//! * [`filter_chain_unspents`](TxGraph::filter_chain_unspents) filters out canonical unspent
28
- //! outputs from a list of outpoints.
28
+ //! outputs from a list of outpoints.
29
29
//! * [`balance`](TxGraph::balance) gets the total sum of unspent outputs filtered from a list of
30
- //! outpoints.
30
+ //! outpoints.
31
31
//! * [`canonical_iter`](TxGraph::canonical_iter) returns the [`CanonicalIter`] which contains all
32
- //! of the canonicalization logic.
32
+ //! of the canonicalization logic.
33
33
//!
34
34
//! All these methods require a `chain` and `chain_tip` argument. The `chain` must be a
35
35
//! [`ChainOracle`] implementation (such as [`LocalChain`](crate::local_chain::LocalChain)) which
39
39
//! transactions have precedence over others:
40
40
//!
41
41
//! * [`Anchor`] - This bit of data represents that a transaction is anchored in a given block. If
42
- //! the transaction is anchored in chain of `chain_tip`, or is an ancestor of a transaction
43
- //! anchored in chain of `chain_tip`, then the transaction must be canonical.
42
+ //! the transaction is anchored in chain of `chain_tip`, or is an ancestor of a transaction
43
+ //! anchored in chain of `chain_tip`, then the transaction must be canonical.
44
44
//! * `last_seen` - This is the timestamp of when a transaction is last-seen in the mempool. This
45
- //! value is updated by [`insert_seen_at`](TxGraph::insert_seen_at) and
46
- //! [`apply_update`](TxGraph::apply_update). Transactions that are seen later have higher
47
- //! priority than those that are seen earlier. `last_seen` values are transitive. This means
48
- //! that the actual `last_seen` value of a transaction is the max of all the `last_seen` values
49
- //! from it's descendants.
45
+ //! value is updated by [`insert_seen_at`](TxGraph::insert_seen_at) and
46
+ //! [`apply_update`](TxGraph::apply_update). Transactions that are seen later have higher priority
47
+ //! than those that are seen earlier. `last_seen` values are transitive. This means that the
48
+ //! actual `last_seen` value of a transaction is the max of all the `last_seen` values from it's
49
+ //! descendants.
50
50
//! * `last_evicted` - This is the timestamp of when a transaction last went missing from the
51
- //! mempool. If this value is equal to or higher than the transaction's `last_seen` value, then
52
- //! it will not be considered canonical.
51
+ //! mempool. If this value is equal to or higher than the transaction's `last_seen` value, then it
52
+ //! will not be considered canonical.
53
53
//!
54
54
//! # Graph traversal
55
55
//!
@@ -392,13 +392,13 @@ impl<A> TxGraph<A> {
392
392
} )
393
393
}
394
394
395
- /// Calculates the fee of a given transaction. Returns [`Amount::ZERO`] if `tx` is a coinbase transaction.
396
- /// Returns `OK(_)` if we have all the [`TxOut`]s being spent by `tx` in the graph (either as
397
- /// the full transactions or individual txouts).
395
+ /// Calculates the fee of a given transaction. Returns [`Amount::ZERO`] if `tx` is a coinbase
396
+ /// transaction. Returns `OK(_)` if we have all the [`TxOut`]s being spent by `tx` in the
397
+ /// graph (either as the full transactions or individual txouts).
398
398
///
399
399
/// To calculate the fee for a [`Transaction`] that depends on foreign [`TxOut`] values you must
400
- /// first manually insert the foreign TxOuts into the tx graph using the [`insert_txout`] function.
401
- /// Only insert TxOuts you trust the values for!
400
+ /// first manually insert the foreign TxOuts into the tx graph using the [`insert_txout`]
401
+ /// function. Only insert TxOuts you trust the values for!
402
402
///
403
403
/// Note `tx` does not have to be in the graph for this to work.
404
404
///
@@ -471,7 +471,7 @@ impl<A: Clone + Ord> TxGraph<A> {
471
471
/// The supplied closure takes in two inputs `(depth, ancestor_tx)`:
472
472
///
473
473
/// * `depth` is the distance between the starting `Transaction` and the `ancestor_tx`. I.e., if
474
- /// the `Transaction` is spending an output of the `ancestor_tx` then `depth` will be 1.
474
+ /// the `Transaction` is spending an output of the `ancestor_tx` then `depth` will be 1.
475
475
/// * `ancestor_tx` is the `Transaction`'s ancestor which we are considering to walk.
476
476
///
477
477
/// The supplied closure returns an `Option<T>`, allowing the caller to map each `Transaction`
@@ -488,8 +488,8 @@ impl<A: Clone + Ord> TxGraph<A> {
488
488
///
489
489
/// The supplied closure takes in two inputs `(depth, descendant_txid)`:
490
490
///
491
- /// * `depth` is the distance between the starting `txid` and the `descendant_txid`. I.e., if the
492
- /// descendant is spending an output of the starting `txid` then `depth` will be 1.
491
+ /// * `depth` is the distance between the starting `txid` and the `descendant_txid`. I.e., if
492
+ /// the descendant is spending an output of the starting `txid` then `depth` will be 1.
493
493
/// * `descendant_txid` is the descendant's txid which we are considering to walk.
494
494
///
495
495
/// The supplied closure returns an `Option<T>`, allowing the caller to map each node it visits
@@ -779,8 +779,8 @@ impl<A: Anchor> TxGraph<A> {
779
779
780
780
/// Extends this graph with the given `update`.
781
781
///
782
- /// The returned [`ChangeSet`] is the set difference between `update` and `self` (transactions that
783
- /// exist in `update` but not in `self`).
782
+ /// The returned [`ChangeSet`] is the set difference between `update` and `self` (transactions
783
+ /// that exist in `update` but not in `self`).
784
784
pub fn apply_update ( & mut self , update : TxUpdate < A > ) -> ChangeSet < A > {
785
785
let mut changeset = ChangeSet :: < A > :: default ( ) ;
786
786
for tx in update. txs {
@@ -1158,7 +1158,9 @@ impl<A: Anchor> TxGraph<A> {
1158
1158
1159
1159
/// List txids that are expected to exist under the given spks.
1160
1160
///
1161
- /// This is used to fill [`SyncRequestBuilder::expected_spk_txids`](bdk_core::spk_client::SyncRequestBuilder::expected_spk_txids).
1161
+ /// This is used to fill
1162
+ /// [`SyncRequestBuilder::expected_spk_txids`](bdk_core::spk_client::SyncRequestBuilder::expected_spk_txids).
1163
+ ///
1162
1164
///
1163
1165
/// The spk index range can be constrained with `range`.
1164
1166
///
0 commit comments