Skip to content

Commit f18db39

Browse files
committed
Also update latest_sync_ timestamps in sync_wallets
... which we previously omitted.
1 parent ea08302 commit f18db39

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
@@ -1098,6 +1098,8 @@ impl Node {
10981098
&*sync_cmon as &(dyn Confirm + Sync + Send),
10991099
&*sync_sweeper as &(dyn Confirm + Sync + Send),
11001100
];
1101+
let sync_wallet_timestamp = Arc::clone(&self.latest_wallet_sync_timestamp);
1102+
let sync_onchain_wallet_timestamp = Arc::clone(&self.latest_onchain_wallet_sync_timestamp);
11011103
let sync_monitor_archival_height = Arc::clone(&self.latest_channel_monitor_archival_height);
11021104

11031105
tokio::task::block_in_place(move || {
@@ -1111,6 +1113,11 @@ impl Node {
11111113
"Sync of on-chain wallet finished in {}ms.",
11121114
now.elapsed().as_millis()
11131115
);
1116+
let unix_time_secs_opt = SystemTime::now()
1117+
.duration_since(UNIX_EPOCH)
1118+
.ok()
1119+
.map(|d| d.as_secs());
1120+
*sync_onchain_wallet_timestamp.write().unwrap() = unix_time_secs_opt;
11141121
},
11151122
Err(e) => {
11161123
log_error!(sync_logger, "Sync of on-chain wallet failed: {}", e);
@@ -1127,6 +1134,12 @@ impl Node {
11271134
now.elapsed().as_millis()
11281135
);
11291136

1137+
let unix_time_secs_opt = SystemTime::now()
1138+
.duration_since(UNIX_EPOCH)
1139+
.ok()
1140+
.map(|d| d.as_secs());
1141+
*sync_wallet_timestamp.write().unwrap() = unix_time_secs_opt;
1142+
11301143
periodically_archive_fully_resolved_monitors(
11311144
archive_cman,
11321145
archive_cmon,

0 commit comments

Comments
 (0)