@@ -10,7 +10,7 @@ use lightning::ln::msgs::{
1010} ;
1111use lightning:: routing:: gossip:: NetworkGraph ;
1212use lightning:: util:: logger:: Logger ;
13- use lightning:: { log_warn, log_trace, log_given_level} ;
13+ use lightning:: { log_debug , log_warn, log_trace, log_given_level, log_gossip } ;
1414use lightning:: util:: ser:: { BigSize , Readable } ;
1515use lightning:: io;
1616
@@ -58,6 +58,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
5858 mut read_cursor : & mut R ,
5959 current_time_unix : Option < u64 >
6060 ) -> Result < u32 , GraphSyncError > {
61+ log_trace ! ( self . logger, "Processing RGS data..." ) ;
6162 let mut prefix = [ 0u8 ; 4 ] ;
6263 read_cursor. read_exact ( & mut prefix) ?;
6364
@@ -110,6 +111,9 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
110111 let node_id_1 = node_ids[ node_id_1_index. 0 as usize ] ;
111112 let node_id_2 = node_ids[ node_id_2_index. 0 as usize ] ;
112113
114+ log_gossip ! ( self . logger, "Adding channel {} from RGS announcement at {}" ,
115+ short_channel_id, latest_seen_timestamp) ;
116+
113117 let announcement_result = network_graph. add_channel_from_partial_announcement (
114118 short_channel_id,
115119 backdated_timestamp as u64 ,
@@ -130,6 +134,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
130134 previous_scid = 0 ; // updates start at a new scid
131135
132136 let update_count: u32 = Readable :: read ( read_cursor) ?;
137+ log_debug ! ( self . logger, "Processing RGS update from {} with {} nodes, {} channel announcements and {} channel updates." ,
138+ latest_seen_timestamp, node_id_count, announcement_count, update_count) ;
133139 if update_count == 0 {
134140 return Ok ( latest_seen_timestamp) ;
135141 }
@@ -217,6 +223,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
217223 continue ;
218224 }
219225
226+ log_gossip ! ( self . logger, "Updating channel {} with flags {} from RGS announcement at {}" ,
227+ short_channel_id, channel_flags, latest_seen_timestamp) ;
220228 match network_graph. update_channel_unsigned ( & synthetic_update) {
221229 Ok ( _) => { } ,
222230 Err ( LightningError { action : ErrorAction :: IgnoreDuplicateGossip , .. } ) => { } ,
@@ -230,6 +238,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
230238
231239 self . network_graph . set_last_rapid_gossip_sync_timestamp ( latest_seen_timestamp) ;
232240 self . is_initial_sync_complete . store ( true , Ordering :: Release ) ;
241+ log_trace ! ( self . logger, "Done processing RGS data from {}" , latest_seen_timestamp) ;
233242 Ok ( latest_seen_timestamp)
234243 }
235244}
0 commit comments