fn wait_for_sync(&self) -> Result<(), String> {
        let resp = self
            .client
            .get_ledger_info(&mobilecoind_api::Empty::new())
            .map_err(|err| format!("Failed getting number of blocks in ledger: {}", err))?;
        let num_blocks = resp.block_count;

        let mut blocks_synced = 0;
        while blocks_synced < num_blocks {
            // Get current number of blocks synced.
            let mut req = mobilecoind_api::GetMonitorStatusRequest::new();
            req.set_monitor_id(self.monitor_id.clone());

            let resp = self
                .client
                .get_monitor_status(&req)
                .map_err(|err| format!("Failed getting monitor status: {}", err))?;

            blocks_synced = resp.get_status().next_block;
        }

        Ok(())
    }
/// Wait for mobilecoind to finish syncing our monitor.
Wait for mobilecoind to finish syncing our monitor.
Wait for mobilecoind to finish syncing our monitor .
fn wait_for_sync(&self) -> Result<(), String> {
        let resp = self
            .client
            .get_ledger_info(&mobilecoind_api::Empty::new())
            .map_err(|err| format!("Failed getting number of blocks in ledger: {}", err))?;
        let num_blocks = resp.block_count;
        let mut blocks_synced = 0;
        while blocks_synced < num_blocks {
            // Get current number of blocks synced.
            let mut req = mobilecoind_api::GetMonitorStatusRequest::new();
            req.set_monitor_id(self.monitor_id.clone());
            let resp = self
                .client
                .get_monitor_status(&req)
                .map_err(|err| format!("Failed getting monitor status: {}", err))?;
            blocks_synced = resp.get_status().next_block;
        }
        Ok(())
    }
fn wait_for_sync ( & self ) -> Result < ( ) , String > { let resp = self . client . get_ledger_info ( & mobilecoind_api :: Empty :: new ( ) ) . map_err ( | err | format ! ( " " err ) ) ? ; let num_blocks = resp . block_count ; let mut blocks_synced = 0 ; while blocks_synced < num_blocks { // Get current number of blocks synced. let mut req = mobilecoind_api :: GetMonitorStatusRequest :: new ( ) ; req . set_monitor_id ( self . monitor_id . clone ( ) ) ; let resp = self . client . get_monitor_status ( & req ) . map_err ( | err | format ! ( " " err ) ) ? ; blocks_synced = resp . get_status ( ) . next_block ; } Ok ( ( ) ) }
Wait for mobilecoind to finish syncing our monitor.
Wait for mobilecoind to finish syncing our monitor .
&self
&self