Add get_next_last_id

This commit is contained in:
Michael Vines 2019-02-07 15:07:10 -08:00
parent c3ad0eebec
commit 0e8540417f
1 changed files with 13 additions and 0 deletions

View File

@ -262,6 +262,19 @@ impl ThinClient {
}
}
/// Request a new last Entry ID from the server. This method blocks
/// until the server sends a response.
pub fn get_next_last_id(&mut self, previous_last_id: &Hash) -> Hash {
loop {
let last_id = self.get_last_id();
if last_id != *previous_last_id {
break last_id;
}
debug!("Got same last_id ({:?}), will retry...", last_id);
sleep(Duration::from_millis(100));
}
}
pub fn submit_poll_balance_metrics(elapsed: &Duration) {
solana_metrics::submit(
influxdb::Point::new("thinclient")