@@ -319,12 +319,11 @@ const ERR: () = "You need at least 32 bit pointers (well, usize, but we'll assum
319
319
/// block_connected() to step towards your best block) upon deserialization before using the
320
320
/// object!
321
321
///
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.
328
327
pub struct ChannelManager < ' a > {
329
328
default_configuration : UserConfig ,
330
329
genesis_hash : Sha256dHash ,
@@ -1494,10 +1493,11 @@ impl<'a> ChannelManager<'a> {
1494
1493
events. append ( & mut new_events) ;
1495
1494
}
1496
1495
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.
1501
1501
pub fn timer_chan_freshness_every_min ( & self ) {
1502
1502
let _ = self . total_consistency_lock . read ( ) . unwrap ( ) ;
1503
1503
let mut channel_state_lock = self . channel_state . lock ( ) . unwrap ( ) ;
0 commit comments