Add version note in `Confirm` docs
authorElias Rohrer <ero@tnull.de>
Tue, 31 Jan 2023 23:15:46 +0000 (17:15 -0600)
committerElias Rohrer <ero@tnull.de>
Tue, 31 Jan 2023 23:56:42 +0000 (17:56 -0600)
While now `ChannelManager` will only return previously confirmed
transactions, we can't ensure the same for `ChainMonitor`, as we need to
maintain backwards compatibility with version prior to 0.0.113, at which
we started tracking the block hash in `ChannelMonitor`s. We therefore
add a note to the docs stating that users need to track confirmations on
their own for channels created prior to 0.0.113.

lightning/src/chain/mod.rs

index 01eae488700605b2f23c50d5fdfdc0c2319859bc..0370c0840f9b611c99f84f41191ea72d1a5644b5 100644 (file)
@@ -176,6 +176,9 @@ pub trait Confirm {
        /// Returns transactions that must be monitored for reorganization out of the chain along
        /// with the hash of the block as part of which it had been previously confirmed.
        ///
+       /// Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
+       /// 0.0.112 and prior, in which case you need to manually track previous confirmations.
+       ///
        /// Will include any transactions passed to [`transactions_confirmed`] that have insufficient
        /// confirmations to be safe from a chain reorganization. Will not include any transactions
        /// passed to [`transaction_unconfirmed`], unless later reconfirmed.