Skip to content

Commit 9dba3ac

Browse files
committed
Also update latest_sync_ timestamps in sync_wallets
... which we previously omitted.
1 parent a503eb5 commit 9dba3ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,6 +1149,8 @@ impl Node {
11491149
&*sync_cmon as &(dyn Confirm + Sync + Send),
11501150
&*sync_sweeper as &(dyn Confirm + Sync + Send),
11511151
];
1152+
let sync_wallet_timestamp = Arc::clone(&self.latest_wallet_sync_timestamp);
1153+
let sync_onchain_wallet_timestamp = Arc::clone(&self.latest_onchain_wallet_sync_timestamp);
11521154
let sync_monitor_archival_height = Arc::clone(&self.latest_channel_monitor_archival_height);
11531155

11541156
tokio::task::block_in_place(move || {
@@ -1162,6 +1164,11 @@ impl Node {
11621164
"Sync of on-chain wallet finished in {}ms.",
11631165
now.elapsed().as_millis()
11641166
);
1167+
let unix_time_secs_opt = SystemTime::now()
1168+
.duration_since(UNIX_EPOCH)
1169+
.ok()
1170+
.map(|d| d.as_secs());
1171+
*sync_onchain_wallet_timestamp.write().unwrap() = unix_time_secs_opt;
11651172
},
11661173
Err(e) => {
11671174
log_error!(sync_logger, "Sync of on-chain wallet failed: {}", e);
@@ -1178,6 +1185,12 @@ impl Node {
11781185
now.elapsed().as_millis()
11791186
);
11801187

1188+
let unix_time_secs_opt = SystemTime::now()
1189+
.duration_since(UNIX_EPOCH)
1190+
.ok()
1191+
.map(|d| d.as_secs());
1192+
*sync_wallet_timestamp.write().unwrap() = unix_time_secs_opt;
1193+
11811194
periodically_archive_fully_resolved_monitors(
11821195
archive_cman,
11831196
archive_cmon,

0 commit comments

Comments
 (0)