From: Chris Waterson Date: Mon, 16 Oct 2023 22:45:14 +0000 (-0700) Subject: Fix comment location X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=27596822f21956f40137cedab91f81a8f5137307;p=rust-lightning Fix comment location Actually put the comment in the right place i.e. _before_ we start updating our local state! :) --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 4d88ed3b5..47149cbe3 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -6798,6 +6798,8 @@ impl InboundV1Channel 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 InboundV1Channel 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());