From 6540fa9121fede615c710cde26b1ba9f59e14f53 Mon Sep 17 00:00:00 2001 From: Stephen Akridge Date: Mon, 8 Apr 2019 17:32:22 +0000 Subject: [PATCH] Add sleep for check_signature --- client/src/rpc_client.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index 56f425e487..de71c30a20 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -400,13 +400,12 @@ impl RpcClient { Ok(()) } - /// Check a signature in the bank. This method blocks - /// until the server sends a response. + /// Check a signature in the bank. pub fn check_signature(&self, signature: &Signature) -> bool { trace!("check_signature: {:?}", signature); let params = json!([format!("{}", signature)]); - loop { + for _ in 0..30 { let response = self.client .send(&RpcRequest::ConfirmTransaction, Some(params.clone()), 0); @@ -426,7 +425,10 @@ impl RpcClient { debug!("check_signature request failed: {:?}", err); } }; + sleep(Duration::from_millis(250)); } + + panic!("Couldn't check signature of {}", signature); } /// Poll the server to confirm a transaction.