Skip to content

Commit 4f06d7a

Browse files
committed
Update pre-HTLC DataLossProtect to match new spec changes
This was the way DataLossProtect was originally written, however it didn't match other implementations at the time during testing. It turns out, other implementations didn't agree with each other anyway (depending on the exact timeline), so the spec was clarified somewhat in lightning/bolts#550 . This updates us to be in line with the new guidance and appears to solve out-of-sync issues in testing.
1 parent d850e12 commit 4f06d7a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,10 +3444,10 @@ impl<ChanSigner: ChannelKeys> Channel<ChanSigner> {
34443444
my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number + 1))
34453445
})
34463446
} else {
3447-
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");
3447+
log_info!(self, "Sending a data_loss_protect with no previous remote per_commitment_secret");
34483448
OptionalField::Present(DataLossProtect {
34493449
your_last_per_commitment_secret: [0;32],
3450-
my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number))
3450+
my_current_per_commitment_point: PublicKey::from_secret_key(&self.secp_ctx, &self.build_local_commitment_secret(self.cur_local_commitment_transaction_number + 1))
34513451
})
34523452
};
34533453
msgs::ChannelReestablish {

0 commit comments

Comments
 (0)