Fix apparent error in sending DataLossProtect
authorMatt Corallo <git@bluematt.me>
Sat, 15 Feb 2020 03:32:30 +0000 (22:32 -0500)
committerMatt Corallo <git@bluematt.me>
Sun, 1 Mar 2020 04:26:16 +0000 (23:26 -0500)
XXX: IIRC this was updated on the RFCs

lightning/src/ln/channel.rs

index b0f54450395eaabc42372d0cf3d3fdfa7b79fe98..471dcbf2297ba6b255477caae036750a44d0b4ec 100644 (file)
@@ -3448,7 +3448,7 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
                        log_debug!(self, "We don't seen yet any revoked secret, if this channnel has already been updated it means we are fallen-behind, you should wait for other peer closing");
                        OptionalField::Present(DataLossProtect {
                                your_last_per_commitment_secret: [0;32],
-                               my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number))
+                               my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number + 1))
                        })
                };
                msgs::ChannelReestablish {