@@ -529,6 +529,15 @@ fn build_with_store_internal(
529
529
liquidity_source_config : Option < & LiquiditySourceConfig > , seed_bytes : [ u8 ; 64 ] ,
530
530
logger : Arc < FilesystemLogger > , kv_store : Arc < DynStore > ,
531
531
) -> Result < Node , BuildError > {
532
+ // Initialize the status fields.
533
+ let is_listening = Arc :: new ( AtomicBool :: new ( false ) ) ;
534
+ let latest_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
535
+ let latest_onchain_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
536
+ let latest_fee_rate_cache_update_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
537
+ let latest_rgs_snapshot_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
538
+ let latest_node_announcement_broadcast_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
539
+ let latest_channel_monitor_archival_height = Arc :: new ( RwLock :: new ( None ) ) ;
540
+
532
541
// Initialize the on-chain wallet and chain access
533
542
let xprv = bitcoin:: bip32:: Xpriv :: new_master ( config. network , & seed_bytes) . map_err ( |e| {
534
543
log_error ! ( logger, "Failed to derive master secret: {}" , e) ;
@@ -578,6 +587,10 @@ fn build_with_store_internal(
578
587
Arc :: clone ( & tx_broadcaster) ,
579
588
Arc :: clone ( & config) ,
580
589
Arc :: clone ( & logger) ,
590
+ Arc :: clone ( & latest_wallet_sync_timestamp) ,
591
+ Arc :: clone ( & latest_onchain_wallet_sync_timestamp) ,
592
+ Arc :: clone ( & latest_fee_rate_cache_update_timestamp) ,
593
+ latest_channel_monitor_archival_height,
581
594
) ) ,
582
595
None => {
583
596
// Default to Esplora client.
@@ -589,6 +602,10 @@ fn build_with_store_internal(
589
602
Arc :: clone ( & tx_broadcaster) ,
590
603
Arc :: clone ( & config) ,
591
604
Arc :: clone ( & logger) ,
605
+ Arc :: clone ( & latest_wallet_sync_timestamp) ,
606
+ Arc :: clone ( & latest_onchain_wallet_sync_timestamp) ,
607
+ Arc :: clone ( & latest_fee_rate_cache_update_timestamp) ,
608
+ latest_channel_monitor_archival_height,
592
609
) )
593
610
} ,
594
611
} ;
@@ -955,14 +972,6 @@ fn build_with_store_internal(
955
972
let ( stop_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
956
973
let ( event_handling_stopped_sender, _) = tokio:: sync:: watch:: channel ( ( ) ) ;
957
974
958
- let is_listening = Arc :: new ( AtomicBool :: new ( false ) ) ;
959
- let latest_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
960
- let latest_onchain_wallet_sync_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
961
- let latest_fee_rate_cache_update_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
962
- let latest_rgs_snapshot_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
963
- let latest_node_announcement_broadcast_timestamp = Arc :: new ( RwLock :: new ( None ) ) ;
964
- let latest_channel_monitor_archival_height = Arc :: new ( RwLock :: new ( None ) ) ;
965
-
966
975
Ok ( Node {
967
976
runtime,
968
977
stop_sender,
@@ -994,7 +1003,6 @@ fn build_with_store_internal(
994
1003
latest_fee_rate_cache_update_timestamp,
995
1004
latest_rgs_snapshot_timestamp,
996
1005
latest_node_announcement_broadcast_timestamp,
997
- latest_channel_monitor_archival_height,
998
1006
} )
999
1007
}
1000
1008
0 commit comments