]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Update documentation on `Channel::set_outbound_scid_alias` 2023-08-err-pre-accept
authorMatt Corallo <git@bluematt.me>
Thu, 17 Aug 2023 03:35:56 +0000 (03:35 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 17 Aug 2023 03:35:56 +0000 (03:35 +0000)
...and replace an assertion with a debug_assertion

lightning/src/ln/channel.rs

index 3d90084dba42af75b708ac834425baf0b86c1ea9..d5cefc943616624ea2dbe1ad2a97e078764cc419 100644 (file)
@@ -1000,9 +1000,10 @@ impl<Signer: ChannelSigner> ChannelContext<Signer> {
        }
 
        /// Only allowed immediately after deserialization if get_outbound_scid_alias returns 0,
-       /// indicating we were written by LDK prior to 0.0.106 which did not set outbound SCID aliases.
+       /// indicating we were written by LDK prior to 0.0.106 which did not set outbound SCID aliases
+       /// or prior to any channel actions during `Channel` initialization.
        pub fn set_outbound_scid_alias(&mut self, outbound_scid_alias: u64) {
-               assert_eq!(self.outbound_scid_alias, 0);
+               debug_assert_eq!(self.outbound_scid_alias, 0);
                self.outbound_scid_alias = outbound_scid_alias;
        }