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
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2275,6 +2275,20 @@ impl Channel {
2275
2275
returnErr(ChannelError::Close("Peer sent a garbage channel_reestablish"));
2276
2276
}
2277
2277
2278
+
//Check for dataloss fields and fail channel
2279
+
ifletSome(ref data_loss) = msg.data_loss_protect{
2280
+
//check if provided signature is a valid signature from us
2281
+
if chan_utils::build_commitment_secret(self.local_keys.commitment_seed, msg.next_remote_commitment_number-1) != data_loss.your_last_per_commitment_secret{
2282
+
returnErr(ChannelError::Close("Peer sent a garbage channel_reestablish with secret key not from us"));
2283
+
}
2284
+
//check if we have fallen beind
2285
+
//We should not broadcast commitment transaction
2286
+
if msg.next_remote_commitment_number > self.cur_local_commitment_transaction_number{
2287
+
returnErr(ChannelError::Close("We have fallen behind and we cannot catch up, need to close channel but not publish commitment"));
0 commit comments