Clarify docs on `provide_channel_parameters`
authorMatt Corallo <git@bluematt.me>
Tue, 6 Dec 2022 18:16:46 +0000 (18:16 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 13 Dec 2022 21:31:40 +0000 (21:31 +0000)
Its very confusing to say that LDK will call
`provide_channel_parameters` more than once - its true for a
channel, but not for a given instance. Instead, phrase the docs
with reference to a specific instance, which is much clearer.

lightning/src/chain/keysinterface.rs

index 1426ff5ce887f4d0ef440874ab9df00849de978a..c0488d11c29b6374bfb171024992f5011832b5a9 100644 (file)
@@ -395,9 +395,12 @@ pub trait BaseSign {
        fn sign_channel_announcement(&self, msg: &UnsignedChannelAnnouncement, secp_ctx: &Secp256k1<secp256k1::All>)
                -> Result<(Signature, Signature), ()>;
        /// Set the counterparty static channel data, including basepoints,
-       /// `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these
-       /// are static channel data, they MUST NOT be allowed to change to different values once set,
-       /// as LDK may call this method more than once.
+       /// `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint.
+       ///
+       /// This data is static, and will never change for a channel once set. For a given [`BaseSign`]
+       /// instance, LDK will call this method exactly once - either immediately after construction
+       /// (not including if done via [`KeysInterface::read_chan_signer`]) or when the funding
+       /// information has been generated.
        ///
        /// channel_parameters.is_populated() MUST be true.
        fn provide_channel_parameters(&mut self, channel_parameters: &ChannelTransactionParameters);