diff --git a/client/src/rpc.rs b/client/src/rpc.rs index f91611b..55b65dc 100644 --- a/client/src/rpc.rs +++ b/client/src/rpc.rs @@ -61,6 +61,7 @@ pub struct ServerInfo { pub network: String, pub tip: ChainAnchor, pub chain: ChainInfo, + pub ready: bool, pub progress: f32, } @@ -1593,12 +1594,17 @@ fn get_space_key(space_or_hash: &str) -> Result { } -async fn get_server_info(client: &reqwest::Client, rpc: &BitcoinRpc, tip: ChainAnchor) -> anyhow::Result { +async fn get_server_info( + client: &reqwest::Client, + rpc: &BitcoinRpc, + tip: ChainAnchor, +) -> anyhow::Result { #[derive(Deserialize)] struct Info { pub chain: String, pub headers: u32, pub blocks: u32, + pub headerssynced: Option, } let info: Info = rpc @@ -1621,6 +1627,7 @@ async fn get_server_info(client: &reqwest::Client, rpc: &BitcoinRpc, tip: ChainA blocks: info.blocks, headers: info.headers, }, + ready: info.headerssynced.unwrap_or(true), progress: calc_progress(start_block, tip.height, info.headers), }) }