@@ -293,9 +293,7 @@ impl Node {
293293
294294 if self . gossip_source . is_rgs ( ) {
295295 let gossip_source = Arc :: clone ( & self . gossip_source ) ;
296- let gossip_sync_store = Arc :: clone ( & self . kv_store ) ;
297296 let gossip_sync_logger = Arc :: clone ( & self . logger ) ;
298- let gossip_node_metrics = Arc :: clone ( & self . node_metrics ) ;
299297 let mut stop_gossip_sync = self . stop_sender . subscribe ( ) ;
300298 self . runtime . spawn_cancellable_background_task ( async move {
301299 let mut interval = tokio:: time:: interval ( RGS_SYNC_INTERVAL ) ;
@@ -311,20 +309,12 @@ impl Node {
311309 _ = interval. tick( ) => {
312310 let now = Instant :: now( ) ;
313311 match gossip_source. update_rgs_snapshot( ) . await {
314- Ok ( updated_timestamp ) => {
312+ Ok ( _ ) => {
315313 log_info!(
316314 gossip_sync_logger,
317315 "Background sync of RGS gossip data finished in {}ms." ,
318316 now. elapsed( ) . as_millis( )
319317 ) ;
320- {
321- let mut locked_node_metrics = gossip_node_metrics. write( ) . unwrap( ) ;
322- locked_node_metrics. latest_rgs_snapshot_timestamp = Some ( updated_timestamp) ;
323- write_node_metrics( & * locked_node_metrics, & * gossip_sync_store, Arc :: clone( & gossip_sync_logger) )
324- . unwrap_or_else( |e| {
325- log_error!( gossip_sync_logger, "Persistence failed: {}" , e) ;
326- } ) ;
327- }
328318 }
329319 Err ( e) => {
330320 log_error!(
@@ -753,7 +743,7 @@ impl Node {
753743 let latest_fee_rate_cache_update_timestamp =
754744 locked_node_metrics. latest_fee_rate_cache_update_timestamp ;
755745 let latest_rgs_snapshot_timestamp =
756- locked_node_metrics . latest_rgs_snapshot_timestamp . map ( |val| val as u64 ) ;
746+ self . network_graph . get_last_rapid_gossip_sync_timestamp ( ) . map ( |val| val as u64 ) ;
757747 let latest_pathfinding_scores_sync_timestamp =
758748 locked_node_metrics. latest_pathfinding_scores_sync_timestamp ;
759749 let latest_node_announcement_broadcast_timestamp =
@@ -1982,7 +1972,6 @@ pub(crate) struct NodeMetrics {
19821972 latest_lightning_wallet_sync_timestamp : Option < u64 > ,
19831973 latest_onchain_wallet_sync_timestamp : Option < u64 > ,
19841974 latest_fee_rate_cache_update_timestamp : Option < u64 > ,
1985- latest_rgs_snapshot_timestamp : Option < u32 > ,
19861975 latest_pathfinding_scores_sync_timestamp : Option < u64 > ,
19871976 latest_node_announcement_broadcast_timestamp : Option < u64 > ,
19881977}
@@ -1993,7 +1982,6 @@ impl Default for NodeMetrics {
19931982 latest_lightning_wallet_sync_timestamp : None ,
19941983 latest_onchain_wallet_sync_timestamp : None ,
19951984 latest_fee_rate_cache_update_timestamp : None ,
1996- latest_rgs_snapshot_timestamp : None ,
19971985 latest_pathfinding_scores_sync_timestamp : None ,
19981986 latest_node_announcement_broadcast_timestamp : None ,
19991987 }
@@ -2005,7 +1993,8 @@ impl_writeable_tlv_based!(NodeMetrics, {
20051993 ( 1 , latest_pathfinding_scores_sync_timestamp, option) ,
20061994 ( 2 , latest_onchain_wallet_sync_timestamp, option) ,
20071995 ( 4 , latest_fee_rate_cache_update_timestamp, option) ,
2008- ( 6 , latest_rgs_snapshot_timestamp, option) ,
1996+ // 6 used to be latest_rgs_snapshot_timestamp
1997+ ( 6 , _legacy_latest_rgs_snapshot_timestamp, ( legacy, u32 , |_| Ok ( ( ) ) , |_: & NodeMetrics | None :: <Option <u32 >> ) ) ,
20091998 ( 8 , latest_node_announcement_broadcast_timestamp, option) ,
20101999 // 10 used to be latest_channel_monitor_archival_height
20112000 ( 10 , _legacy_latest_channel_monitor_archival_height, ( legacy, u32 , |_| Ok ( ( ) ) , |_: & NodeMetrics | None :: <Option <u32 >> ) ) ,
0 commit comments