Skip to content

Commit 80fa9e2

Browse files
committed
f fix comments
1 parent 795493c commit 80fa9e2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3599,9 +3599,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
35993599
let updates = channel.get_mut().monitor_updating_restored(&self.logger, self.get_our_node_id(), self.genesis_hash, self.best_block.read().unwrap().height());
36003600
let channel_update = if updates.funding_locked.is_some() && channel.get().is_usable() {
36013601
// We only send a channel_update in the case where we are just now sending a
3602-
// funding_locked and the channel is in a usable state. Further, we rely on the
3603-
// normal announcement_signatures process to send a channel_update for public
3604-
// channels, only generating a unicast channel_update if this is a private channel.
3602+
// funding_locked and the channel is in a usable state. We may re-send a
3603+
// channel_update later through the announcement_signatures process for public
3604+
// channels, but there's no reason not to just inform our counterparty of our fees
3605+
// now.
36053606
Some(events::MessageSendEvent::SendChannelUpdate {
36063607
node_id: channel.get().get_counterparty_node_id(),
36073608
msg: self.get_channel_update_for_unicast(channel.get()).unwrap(),
@@ -3782,6 +3783,11 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
37823783
msg: announcement_sigs,
37833784
});
37843785
} else if chan.get().is_usable() {
3786+
// If we're sending an announcement_signatures, we'll send the (public)
3787+
// channel_update after sending a channel_announcement when we receive our
3788+
// counterparty's announcement_signatures. Thus, we only bother to send a
3789+
// channel_update here if the channel is not public, i.e. we're not sending an
3790+
// announcement_signatures.
37853791
log_trace!(self.logger, "Sending private initial channel_update for our counterparty on channel {}", log_bytes!(chan.get().channel_id()));
37863792
channel_state.pending_msg_events.push(events::MessageSendEvent::SendChannelUpdate {
37873793
node_id: counterparty_node_id.clone(),

0 commit comments

Comments
 (0)