@@ -3524,7 +3524,13 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
3524
3524
}
3525
3525
}
3526
3526
3527
- /// Gets the set of txids which should be monitored for their confirmation state. XXX: Docs
3527
+ /// Gets the set of txids which should be monitored for their confirmation state.
3528
+ ///
3529
+ /// If you're providing information about reorganizations via [`transaction_unconfirmed`], this
3530
+ /// is the set of transactions which you may been to call [`transaction_unconfirmed`] for.
3531
+ ///
3532
+ /// Note that this is NOT the set of transactions which must be included in calls to
3533
+ /// [`transactions_confirmed`] if they are confirmed, but a small subset of it.
3528
3534
pub fn get_relevant_txids ( & self ) -> Vec < Txid > {
3529
3535
let channel_state = self . channel_state . lock ( ) . unwrap ( ) ;
3530
3536
let mut res = Vec :: with_capacity ( channel_state. short_to_id . len ( ) ) ;
@@ -3536,7 +3542,19 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
3536
3542
res
3537
3543
}
3538
3544
3539
- /// Marks a transaction as having been reorganized out of the blockchain XXX: Docs
3545
+ /// Marks a transaction as having been reorganized out of the blockchain.
3546
+ ///
3547
+ /// If a transaction is included in [`get_relevant_txids`], and is no longer in the main branch
3548
+ /// of the blockchain, this function should be called to indicate that the transaction should
3549
+ /// be considered reorganized out.
3550
+ ///
3551
+ /// Once this is called, the given transaction will no longer appear on [`get_relevant_txids`],
3552
+ /// though this may be called repeatedly for a given transaction without issue.
3553
+ ///
3554
+ /// Note that if the transaction is confirmed on the main chain in a different block (indicated
3555
+ /// via a call to [`transactions_confirmed`]), it may re-appear in [`get_relevant_txids`], thus
3556
+ /// be very weary of race-conditions wherein the final state of a transaction indicated via
3557
+ /// these APIs is not the same as its state on the blockchain.
3540
3558
pub fn transaction_unconfirmed ( & self , txid : & Txid ) {
3541
3559
let _persistence_guard = PersistenceNotifierGuard :: new ( & self . total_consistency_lock , & self . persistence_notifier ) ;
3542
3560
self . do_chain_event ( None , |channel| {
0 commit comments