Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lightning/src/ln/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12525,9 +12525,9 @@ where
self.context.pending_outbound_htlcs.push(OutboundHTLCOutput {
htlc_id: self.context.next_holder_htlc_id,
amount_msat,
payment_hash: payment_hash.clone(),
payment_hash,
cltv_expiry,
state: OutboundHTLCState::LocalAnnounced(Box::new(onion_routing_packet.clone())),
state: OutboundHTLCState::LocalAnnounced(Box::new(onion_routing_packet)),
source,
blinding_point,
skimmed_fee_msat,
Expand Down
39 changes: 30 additions & 9 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15112,8 +15112,6 @@ impl<
}
}

log_debug!(logger, "Generating channel_reestablish events");

let per_peer_state = self.per_peer_state.read().unwrap();
if let Some(peer_state_mutex) = per_peer_state.get(&counterparty_node_id) {
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
Expand All @@ -15131,22 +15129,45 @@ impl<
let logger = WithChannelContext::from(&self.logger, &chan.context(), None);
match chan.peer_connected_get_handshake(self.chain_hash, &&logger) {
ReconnectionMsg::Reestablish(msg) => {
log_debug!(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ironically this is actually our only place we log at DEBUG (or higher) when a peer connects, can we add variants of this in the other branches (including None, I think, if we have a Channel entry for a peer makes sense to log).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(including None, I think, if we have a Channel entry for a peer makes sense to log).

I wasn't sure when this would happen, seems only when the signer hasn't provided a point so I just added a generic peer reconnection msg.

logger,
"Generated channel_reestablish event for channel {}",
chan.context().channel_id()
);
pending_msg_events.push(MessageSendEvent::SendChannelReestablish {
node_id: chan.context().get_counterparty_node_id(),
msg,
})
},
ReconnectionMsg::Open(OpenChannelMessage::V1(msg)) => pending_msg_events
.push(MessageSendEvent::SendOpenChannel {
ReconnectionMsg::Open(OpenChannelMessage::V1(msg)) => {
log_debug!(
logger,
"Generated open_channel event for channel {}",
chan.context().channel_id()
);
pending_msg_events.push(MessageSendEvent::SendOpenChannel {
node_id: chan.context().get_counterparty_node_id(),
msg,
}),
ReconnectionMsg::Open(OpenChannelMessage::V2(msg)) => pending_msg_events
.push(MessageSendEvent::SendOpenChannelV2 {
});
},
ReconnectionMsg::Open(OpenChannelMessage::V2(msg)) => {
log_debug!(
logger,
"Generated open_channel_v2 event for channel {}",
chan.context().channel_id()
);
pending_msg_events.push(MessageSendEvent::SendOpenChannelV2 {
node_id: chan.context().get_counterparty_node_id(),
msg,
}),
ReconnectionMsg::None => {},
});
},
ReconnectionMsg::None => {
log_debug!(
logger,
"Peer reconnected. No reconnection message for channel {}",
chan.context().channel_id()
);
},
}
}
}
Expand Down
Loading