File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 3030 Ok ( ( ) )
3131}
3232
33+ /// Demonstate how we handle the following situations:
34+ ///
35+ /// ## An outgoing transaction depends on an incoming transaction that gets replaced.
36+ ///
37+ /// Given:
38+ /// * Wallet receives an incoming unconfirmed transaction.
39+ /// * Wallet creates outgoing transaction that spends from the incoming transaction.
40+ /// * The wallet tracks the outgoing transaction (with `wallet.track_tx`).
41+ /// * The incoming transaction gets replaced.
42+ ///
43+ /// When:
44+ /// * `wallet.uncanonical_txs` is called, expect:
45+ /// * 1 transaction is returned (the created outgoing transaction).
46+ /// * `UncanonicalTx::is_safe_to_untrack(0)` should return true.
47+ /// * `UncanonicalTx::is_safe_to_untrack(>0)` should return false.
48+ /// * TODO: Can replace == false, no inputs available.
49+
3350/// Receive an unconfirmed tx, spend from it, and the unconfirmed tx get's RBF'ed.
3451/// Our API should be able to recognise that the outgoing tx became evicted and allow the caller
3552/// to respond accordingly.
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ impl<A: Anchor> UncanonicalTx<A> {
355355 }
356356
357357 /// Iterate over transactions that are currently canonical in the network, but would be rendered
358- /// uncanonical if this transaction were to become canonical.
358+ /// uncanonical (be replaced) if this transaction were to become canonical.
359359 ///
360360 /// This includes both direct and indirect conflicts, such as any transaction that relies on
361361 /// conflicting ancestry.
You can’t perform that action at this time.
0 commit comments