From: Matt Corallo <649246+TheBlueMatt@users.noreply.github.com> Date: Tue, 17 Mar 2020 18:49:06 +0000 (+0000) Subject: Merge pull request #537 from TheBlueMatt/2020-03-data-loss-spec-550 X-Git-Tag: v0.0.12~100 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=33b7c906f2ec1522e466a42ca70b82806d89d8a6;hp=feb0a9fbccfffd86baace1d42126a4a2f1d3b14d;p=rust-lightning Merge pull request #537 from TheBlueMatt/2020-03-data-loss-spec-550 Update pre-HTLC DataLossProtect to match new spec changes --- diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 86074627..81762923 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -3444,10 +3444,10 @@ impl Channel { my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number + 1)) }) } else { - 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"); + log_info!(self, "Sending a data_loss_protect with no previous remote per_commitment_secret"); 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 {