parent
020d34187c
commit
67d7375ab9
|
@ -397,6 +397,7 @@ impl RpcClient {
|
||||||
|
|
||||||
pub fn get_new_blockhash(&self, blockhash: &Hash) -> io::Result<(Hash, FeeCalculator)> {
|
pub fn get_new_blockhash(&self, blockhash: &Hash) -> io::Result<(Hash, FeeCalculator)> {
|
||||||
let mut num_retries = 10;
|
let mut num_retries = 10;
|
||||||
|
let start = Instant::now();
|
||||||
while num_retries > 0 {
|
while num_retries > 0 {
|
||||||
if let Ok((new_blockhash, fee_calculator)) = self.get_recent_blockhash() {
|
if let Ok((new_blockhash, fee_calculator)) = self.get_recent_blockhash() {
|
||||||
if new_blockhash != *blockhash {
|
if new_blockhash != *blockhash {
|
||||||
|
@ -413,7 +414,11 @@ impl RpcClient {
|
||||||
}
|
}
|
||||||
Err(io::Error::new(
|
Err(io::Error::new(
|
||||||
io::ErrorKind::Other,
|
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
|
||||||
|
),
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue