gui(cache): include sync progress

This commit is contained in:
Michael Mallan 2024-10-28 10:19:11 +00:00
parent f3a136c30b
commit 62788d105c
No known key found for this signature in database
GPG Key ID: 5177CDCEDB0EABEB
4 changed files with 5 additions and 0 deletions

View File

@ -9,6 +9,7 @@ pub struct Cache {
pub blockheight: i32,
pub coins: Vec<Coin>,
pub rescan_progress: Option<f64>,
pub sync_progress: f64,
pub last_poll_timestamp: Option<u32>,
}
@ -21,6 +22,7 @@ impl std::default::Default for Cache {
blockheight: 0,
coins: Vec::new(),
rescan_progress: None,
sync_progress: 1.0,
last_poll_timestamp: None,
}
}

View File

@ -282,6 +282,7 @@ impl App {
network: info.network,
blockheight: info.block_height,
rescan_progress: info.rescan_progress,
sync_progress: info.sync,
last_poll_timestamp: info.last_poll_timestamp,
})
},

View File

@ -380,6 +380,7 @@ pub async fn load_application(
network: info.network,
blockheight: info.block_height,
coins,
sync_progress: info.sync,
last_poll_timestamp: info.last_poll_timestamp,
..Default::default()
};

View File

@ -459,6 +459,7 @@ pub fn create_app_with_remote_backend(
network,
coins: Vec::new(),
rescan_progress: None,
sync_progress: 1.0, // Remote backend is always synced
datadir_path: datadir.clone(),
blockheight: wallet.tip_height.unwrap_or(0),
last_poll_timestamp: None, // We ignore this field for remote backend.