diff --git a/src/thin_client.rs b/src/thin_client.rs index c2d0599978..c255b99005 100644 --- a/src/thin_client.rs +++ b/src/thin_client.rs @@ -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")