@@ -10,7 +10,7 @@ use lightning::ln::msgs::{
10
10
} ;
11
11
use lightning:: routing:: gossip:: NetworkGraph ;
12
12
use 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 } ;
14
14
use lightning:: util:: ser:: { BigSize , Readable } ;
15
15
use lightning:: io;
16
16
@@ -58,6 +58,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
58
58
mut read_cursor : & mut R ,
59
59
current_time_unix : Option < u64 >
60
60
) -> Result < u32 , GraphSyncError > {
61
+ log_trace ! ( self . logger, "Processing RGS data..." ) ;
61
62
let mut prefix = [ 0u8 ; 4 ] ;
62
63
read_cursor. read_exact ( & mut prefix) ?;
63
64
@@ -110,6 +111,9 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
110
111
let node_id_1 = node_ids[ node_id_1_index. 0 as usize ] ;
111
112
let node_id_2 = node_ids[ node_id_2_index. 0 as usize ] ;
112
113
114
+ log_gossip ! ( self . logger, "Adding channel {} from RGS announcement at {}" ,
115
+ short_channel_id, latest_seen_timestamp) ;
116
+
113
117
let announcement_result = network_graph. add_channel_from_partial_announcement (
114
118
short_channel_id,
115
119
backdated_timestamp as u64 ,
@@ -130,6 +134,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
130
134
previous_scid = 0 ; // updates start at a new scid
131
135
132
136
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) ;
133
139
if update_count == 0 {
134
140
return Ok ( latest_seen_timestamp) ;
135
141
}
@@ -217,6 +223,8 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
217
223
continue ;
218
224
}
219
225
226
+ log_gossip ! ( self . logger, "Updating channel {} with flags {} from RGS announcement at {}" ,
227
+ short_channel_id, channel_flags, latest_seen_timestamp) ;
220
228
match network_graph. update_channel_unsigned ( & synthetic_update) {
221
229
Ok ( _) => { } ,
222
230
Err ( LightningError { action : ErrorAction :: IgnoreDuplicateGossip , .. } ) => { } ,
@@ -230,6 +238,7 @@ impl<NG: Deref<Target=NetworkGraph<L>>, L: Deref> RapidGossipSync<NG, L> where L
230
238
231
239
self . network_graph . set_last_rapid_gossip_sync_timestamp ( latest_seen_timestamp) ;
232
240
self . is_initial_sync_complete . store ( true , Ordering :: Release ) ;
241
+ log_trace ! ( self . logger, "Done processing RGS data from {}" , latest_seen_timestamp) ;
233
242
Ok ( latest_seen_timestamp)
234
243
}
235
244
}
0 commit comments