Skip to content

Commit fbe3943

Browse files
committed
Update comments to be a bit more descriptive and fix english a bit
1 parent da94bac commit fbe3943

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,11 @@ const ERR: () = "You need at least 32 bit pointers (well, usize, but we'll assum
319319
/// block_connected() to step towards your best block) upon deserialization before using the
320320
/// object!
321321
///
322-
/// Note that ChannelManager is responsible of tracking liveness of its channels and by so
323-
/// to generate ChannelUpdate messages intended to be broadcast on the gossip layer. To avoid
324-
/// spam due to quick connection/reconnection, updates should be first stagged then after a period
325-
/// of 1 min flushed to the network through call to timer_chan_freshness_every_min. You may
326-
/// delay or anticipate call to this method to suit your announcements requirements different than
327-
/// the 1 min period.
322+
/// Note that ChannelManager is responsible for tracking liveness of its channels and generating
323+
/// ChannelUpdate messages informing peers that the channel is temporarily disabled. To avoid
324+
/// spam due to quick disconnection/reconnection, updates are not sent until the channel has been
325+
/// offline for a full minute. In order to track this, you must call
326+
/// timer_chan_freshness_every_min roughly once per minute, though it doesn't have to be perfec.
328327
pub struct ChannelManager<'a> {
329328
default_configuration: UserConfig,
330329
genesis_hash: Sha256dHash,
@@ -1494,10 +1493,11 @@ impl<'a> ChannelManager<'a> {
14941493
events.append(&mut new_events);
14951494
}
14961495

1497-
/// Latency/peer disconnection may trigger us to mark as disabled some
1498-
/// of our channels. After some time, if channels are still disabled
1499-
/// we need to broadcast ChannelUpdate to inform other network peers
1500-
/// about the uselessness of this channels.
1496+
/// If a peer is disconnected we mark any channels with that peer as 'disabled'.
1497+
/// After some time, if channels are still disabled we need to broadcast a ChannelUpdate
1498+
/// to inform the network about the uselessness of these channels.
1499+
///
1500+
/// This method handles all the details, and must be called roughly once per minute.
15011501
pub fn timer_chan_freshness_every_min(&self) {
15021502
let _ = self.total_consistency_lock.read().unwrap();
15031503
let mut channel_state_lock = self.channel_state.lock().unwrap();

0 commit comments

Comments
 (0)