Add sleep for check_signature
This commit is contained in:
parent
21287ba554
commit
6540fa9121
|
@ -400,13 +400,12 @@ impl RpcClient {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check a signature in the bank. This method blocks
|
/// Check a signature in the bank.
|
||||||
/// until the server sends a response.
|
|
||||||
pub fn check_signature(&self, signature: &Signature) -> bool {
|
pub fn check_signature(&self, signature: &Signature) -> bool {
|
||||||
trace!("check_signature: {:?}", signature);
|
trace!("check_signature: {:?}", signature);
|
||||||
let params = json!([format!("{}", signature)]);
|
let params = json!([format!("{}", signature)]);
|
||||||
|
|
||||||
loop {
|
for _ in 0..30 {
|
||||||
let response =
|
let response =
|
||||||
self.client
|
self.client
|
||||||
.send(&RpcRequest::ConfirmTransaction, Some(params.clone()), 0);
|
.send(&RpcRequest::ConfirmTransaction, Some(params.clone()), 0);
|
||||||
|
@ -426,7 +425,10 @@ impl RpcClient {
|
||||||
debug!("check_signature request failed: {:?}", err);
|
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.
|
/// Poll the server to confirm a transaction.
|
||||||
|
|
Loading…
Reference in New Issue