From 67d7375ab9039b96e47c6f04904844140990d060 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Fri, 20 Sep 2019 15:50:43 -0700 Subject: [PATCH] Add more descriptive error on a stuck blockhash (#6010) automerge --- client/src/rpc_client.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/rpc_client.rs b/client/src/rpc_client.rs index a7f8aefa8..b0266a16d 100644 --- a/client/src/rpc_client.rs +++ b/client/src/rpc_client.rs @@ -397,6 +397,7 @@ impl RpcClient { pub fn get_new_blockhash(&self, blockhash: &Hash) -> io::Result<(Hash, FeeCalculator)> { let mut num_retries = 10; + let start = Instant::now(); while num_retries > 0 { if let Ok((new_blockhash, fee_calculator)) = self.get_recent_blockhash() { if new_blockhash != *blockhash { @@ -413,7 +414,11 @@ impl RpcClient { } Err(io::Error::new( io::ErrorKind::Other, - "Unable to get new blockhash, too many retries", + format!( + "Unable to get new blockhash after {}ms, stuck at {}", + start.elapsed().as_millis(), + blockhash + ), )) }