@@ -552,6 +552,15 @@ fn build_with_store_internal(
552
552
liquidity_source_config : Option < & LiquiditySourceConfig > , seed_bytes : [ u8 ; 64 ] ,
553
553
logger : Arc < FilesystemLogger > , kv_store : Arc < DynStore > ,
554
554
) -> Result < Node , BuildError > {
555
+ // Initialize the status fields.
556
+ let is_listening = Arc :: new ( AtomicBool :: new ( false ) ) ;
557
+ let latest_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
558
+ let latest_onchain_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
559
+ let latest_fee_rate_cache_update_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
560
+ let latest_rgs_snapshot_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
561
+ let latest_node_announcement_broadcast_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
562
+ let latest_channel_monitor_archival_height = Arc :: new ( RwLock :: new ( None ) ) ;
563
+
555
564
// Initialize the on-chain wallet and chain access
556
565
let xprv = bitcoin:: bip32:: Xpriv :: new_master ( config. network , & seed_bytes) . map_err ( |e| {
557
566
log_error ! ( logger, "Failed to derive master secret: {}" , e) ;
@@ -601,6 +610,10 @@ fn build_with_store_internal(
601
610
Arc :: clone ( & tx_broadcaster) ,
602
611
Arc :: clone ( & config) ,
603
612
Arc :: clone ( & logger) ,
613
+ Arc :: clone ( & latest_wallet_sync_timestamp) ,
614
+ Arc :: clone ( & latest_onchain_wallet_sync_timestamp) ,
615
+ Arc :: clone ( & latest_fee_rate_cache_update_timestamp) ,
616
+ latest_channel_monitor_archival_height,
604
617
) ) ,
605
618
None => {
606
619
// Default to Esplora client.
@@ -612,6 +625,10 @@ fn build_with_store_internal(
612
625
Arc :: clone ( & tx_broadcaster) ,
613
626
Arc :: clone ( & config) ,
614
627
Arc :: clone ( & logger) ,
628
+ Arc :: clone ( & latest_wallet_sync_timestamp) ,
629
+ Arc :: clone ( & latest_onchain_wallet_sync_timestamp) ,
630
+ Arc :: clone ( & latest_fee_rate_cache_update_timestamp) ,
631
+ latest_channel_monitor_archival_height,
615
632
) )
616
633
} ,
617
634
} ;
@@ -978,14 +995,6 @@ fn build_with_store_internal(
978
995
let ( stop_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
979
996
let ( event_handling_stopped_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
980
997
981
- let is_listening = Arc :: new ( AtomicBool :: new ( false ) ) ;
982
- let latest_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
983
- let latest_onchain_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
984
- let latest_fee_rate_cache_update_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
985
- let latest_rgs_snapshot_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
986
- let latest_node_announcement_broadcast_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
987
- let latest_channel_monitor_archival_height = Arc :: new ( RwLock :: new ( None ) ) ;
988
-
989
998
Ok ( Node {
990
999
runtime,
991
1000
stop_sender,
@@ -1017,7 +1026,6 @@ fn build_with_store_internal(
1017
1026
latest_fee_rate_cache_update_timestamp,
1018
1027
latest_rgs_snapshot_timestamp,
1019
1028
latest_node_announcement_broadcast_timestamp,
1020
- latest_channel_monitor_archival_height,
1021
1029
} )
1022
1030
}
1023
1031
0 commit comments