From 81e2d1612f06b1dace2706c92d777b8890c9c972 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Sat, 13 Nov 2021 21:28:55 +0000 Subject: [PATCH] WIP --- lightning/src/ln/channel.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 746222506..c1ae2b81d 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -3596,6 +3596,9 @@ panic!(); // We have OurFundingLocked set! let next_per_commitment_point = self.holder_signer.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx); +// XXX: We need to figure out exactly what format the FundingLocked should take if the channel has +// moved forward already due to receiving payments prior to the funding locking in. +// This needs spec discussion. return Ok(ReestablishResponses { funding_locked: Some(msgs::FundingLocked { channel_id: self.channel_id(), @@ -4389,7 +4392,8 @@ panic!(); if need_commitment_update { if self.channel_state & (ChannelState::MonitorUpdateFailed as u32) == 0 { if self.channel_state & (ChannelState::PeerDisconnected as u32) == 0 { - let next_per_commitment_point = self.holder_signer.get_per_commitment_point(self.cur_holder_commitment_transaction_number, &self.secp_ctx); + let next_per_commitment_point = + self.holder_signer.get_per_commitment_point(INITIAL_COMMITMENT_NUMBER - 1, &self.secp_ctx); return Some(msgs::FundingLocked { channel_id: self.channel_id, next_per_commitment_point, -- 2.39.5