Skip to content

Commit 9b88a14

Browse files
committed
f more comment/docs
1 parent 568f1a7 commit 9b88a14

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lightning/src/ln/peer_handler.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,6 +1940,12 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
19401940
Ok(should_forward)
19411941
}
19421942

1943+
/// Forwards a gossip `msg` to `peers` excluding node(s) that generated the gossip message and
1944+
/// excluding `except_node`.
1945+
///
1946+
/// If the message queue for a peer is somewhat full, the message will not be forwarded to them
1947+
/// unless `allow_large_buffer` is set, in which case the message will be treated as critical
1948+
/// and delivered no matter the available buffer space.
19431949
fn forward_broadcast_msg(&self, peers: &HashMap<Descriptor, Mutex<Peer>>, msg: &wire::Message<<<CMH as Deref>::Target as wire::CustomMessageReader>::CustomMessage>, except_node: Option<&PublicKey>, allow_large_buffer: bool) {
19441950
match msg {
19451951
wire::Message::ChannelAnnouncement(ref msg) => {
@@ -2093,6 +2099,9 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
20932099
}
20942100
}
20952101
}
2102+
2103+
// Handles a `MessageSendEvent`, using `from_chan_handler` to decide if we should
2104+
// robustly gossip broadcast events even if a peer's message buffer is full.
20962105
let mut handle_event = |event, from_chan_handler| {
20972106
match event {
20982107
MessageSendEvent::SendAcceptChannel { ref node_id, ref msg } => {

0 commit comments

Comments
 (0)