]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix comment location
authorChris Waterson <waterson@gmail.com>
Mon, 16 Oct 2023 22:45:14 +0000 (15:45 -0700)
committerChris Waterson <waterson@gmail.com>
Wed, 25 Oct 2023 16:26:34 +0000 (09:26 -0700)
Actually put the comment in the right place i.e. _before_ we start updating
our local state! :)

lightning/src/ln/channel.rs

index 4d88ed3b5782cfcc11cc52ccd7d88e6910a6126d..47149cbe36763c61aa7bcb751c30fea3fbb9366e 100644 (file)
@@ -6798,6 +6798,8 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
                        return Err((self, ChannelError::Close("Failed to validate our commitment".to_owned())));
                }
 
+               // Now that we're past error-generating stuff, update our local state:
+
                self.context.channel_state = ChannelState::FundingSent as u32;
                self.context.channel_id = funding_txo.to_channel_id();
                self.context.cur_counterparty_commitment_transaction_number -= 1;
@@ -6805,8 +6807,6 @@ impl<SP: Deref> InboundV1Channel<SP> where SP::Target: SignerProvider {
 
                let (counterparty_initial_commitment_tx, funding_signed) = self.context.get_funding_signed_msg(logger);
 
-               // Now that we're past error-generating stuff, update our local state:
-
                let funding_redeemscript = self.context.get_funding_redeemscript();
                let funding_txo_script = funding_redeemscript.to_v0_p2wsh();
                let obscure_factor = get_commitment_transaction_number_obscure_factor(&self.context.get_holder_pubkeys().payment_point, &self.context.get_counterparty_pubkeys().payment_point, self.context.is_outbound());