break if no max_wait
This commit is contained in:
parent
5fbcb75157
commit
5747caec71
@ -521,6 +521,7 @@ impl Web3Rpcs {
|
|||||||
|
|
||||||
let mut potential_rpcs = Vec::new();
|
let mut potential_rpcs = Vec::new();
|
||||||
|
|
||||||
|
// TODO: max loop count if no max_wait?
|
||||||
loop {
|
loop {
|
||||||
// TODO: need a change so that protected and 4337 rpcs set watch_consensus_rpcs on start
|
// TODO: need a change so that protected and 4337 rpcs set watch_consensus_rpcs on start
|
||||||
let ranked_rpcs: Option<Arc<RankedRpcs>> =
|
let ranked_rpcs: Option<Arc<RankedRpcs>> =
|
||||||
@ -572,9 +573,9 @@ impl Web3Rpcs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(max_wait) = max_wait {
|
||||||
let waiting_for = min_block_needed.max(max_block_needed);
|
let waiting_for = min_block_needed.max(max_block_needed);
|
||||||
|
|
||||||
if let Some(max_wait) = max_wait {
|
|
||||||
match ranked_rpcs.should_wait_for_block(waiting_for, skip_rpcs) {
|
match ranked_rpcs.should_wait_for_block(waiting_for, skip_rpcs) {
|
||||||
ShouldWaitForBlock::NeverReady => break,
|
ShouldWaitForBlock::NeverReady => break,
|
||||||
ShouldWaitForBlock::Ready => {
|
ShouldWaitForBlock::Ready => {
|
||||||
@ -589,6 +590,8 @@ impl Web3Rpcs {
|
|||||||
_ = sleep_until(start + max_wait) => break,
|
_ = sleep_until(start + max_wait) => break,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if let Some(max_wait) = max_wait {
|
} else if let Some(max_wait) = max_wait {
|
||||||
select! {
|
select! {
|
||||||
|
Loading…
Reference in New Issue
Block a user