Add sleep for check_signature

This commit is contained in:
Stephen Akridge 2019-04-08 17:32:22 +00:00 committed by sakridge
parent 21287ba554
commit 6540fa9121
1 changed files with 5 additions and 3 deletions

View File

@ -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.