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: lightning/src/ln/channel.rs
+1-1
Original file line number
Diff line number
Diff line change
@@ -3993,7 +3993,7 @@ impl<SP: Deref> Channel<SP> where
3993
3993
3994
3994
if msg.next_local_commitment_number >= INITIAL_COMMITMENT_NUMBER || msg.next_remote_commitment_number >= INITIAL_COMMITMENT_NUMBER ||
3995
3995
msg.next_local_commitment_number == 0 {
3996
-
return Err(ChannelError::Close("Peer sent a garbage channel_reestablish (usually an lnd node with lost state asking us to force-close for them)".to_owned()));
3996
+
return Err(ChannelError::Close("Peer sent an invalid channel_reestablish to force close in a non-standard way".to_owned()));
let chan_info_opt = self.short_to_chan_info.read().unwrap().get(&short_chan_id).cloned();
4303
+
let (counterparty_node_id, forward_chan_id) = match chan_info_opt {
4304
+
Some((cp_id, chan_id)) => (cp_id, chan_id),
4303
4305
None => {
4304
4306
forwarding_channel_not_found!();
4305
4307
continue;
@@ -6787,7 +6789,10 @@ where
6787
6789
let peer_state_mutex = per_peer_state.get(counterparty_node_id)
6788
6790
.ok_or_else(|| {
6789
6791
debug_assert!(false);
6790
-
MsgHandleErrInternal::send_err_msg_no_close(format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id), msg.channel_id)
6792
+
MsgHandleErrInternal::send_err_msg_no_close(
6793
+
format!("Can't find a peer matching the passed counterparty node_id {}", counterparty_node_id),
6794
+
msg.channel_id
6795
+
)
6791
6796
})?;
6792
6797
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
6793
6798
let peer_state = &mut *peer_state_lock;
@@ -6831,7 +6836,39 @@ where
6831
6836
"Got a channel_reestablish message for an unfunded channel!".into())), chan_phase_entry);
6832
6837
}
6833
6838
},
6834
-
hash_map::Entry::Vacant(_) => return Err(MsgHandleErrInternal::send_err_msg_no_close(format!("Got a message for a channel from the wrong node! No such channel for the passed counterparty_node_id {}", counterparty_node_id), msg.channel_id))
6839
+
hash_map::Entry::Vacant(_) => {
6840
+
log_debug!(self.logger, "Sending bogus ChannelReestablish for unknown channel {} to force channel closure",
6841
+
log_bytes!(msg.channel_id.0));
6842
+
// Unfortunately, lnd doesn't force close on errors
0 commit comments