Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sleep for check_signature #3677

Merged
merged 1 commit into from
Apr 8, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions client/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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.
Expand Down