You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/ln/channel.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -2343,12 +2343,12 @@ impl Channel {
2343
2343
if msg.next_remote_commitment_number > 0{
2344
2344
ifletSome(ref data_loss) = msg.data_loss_protect{
2345
2345
//check if provided signature is a valid signature from us
2346
-
if chan_utils::build_commitment_secret(self.local_keys.commitment_seed, msg.next_remote_commitment_number-1) != data_loss.your_last_per_commitment_secret{
2346
+
if chan_utils::build_commitment_secret(self.local_keys.commitment_seed,INITIAL_COMMITMENT_NUMBER - msg.next_remote_commitment_number + 1) != data_loss.your_last_per_commitment_secret{
2347
2347
returnErr(ChannelError::Close("Peer sent a garbage channel_reestablish with secret key not matching the commitment height provided"));
2348
2348
}
2349
2349
//check if we have fallen beind
2350
2350
//We should not broadcast commitment transaction or continue
2351
-
if msg.next_remote_commitment_number > self.cur_local_commitment_transaction_number{
2351
+
if msg.next_remote_commitment_number >= INITIAL_COMMITMENT_NUMBER-self.cur_local_commitment_transaction_number{
2352
2352
returnErr(ChannelError::CloseNoPublish("We have fallen behind and we cannot catch up, need to close channel but not publish commitment"));
0 commit comments