Skip to content

Commit

Permalink
fix: fail fast when escrow accounts are missing
Browse files Browse the repository at this point in the history
Previsously, paid queries would stall until timeout while awaiting the
initial eventual value for escrow accounts. This change avoids the
delay, such that the intended error message is returned.
  • Loading branch information
Theodus committed Nov 7, 2023
1 parent 22f6f83 commit 4e19bbd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions common/src/tap_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ impl TapManager {
})?;
if !self
.escrow_accounts
.value()
.await
.map(|accounts| {
accounts
.get(&receipt_signer)
.map_or(false, |balance| balance > &U256::zero())
})
.unwrap_or(false)
.value_immediate()
.unwrap_or_default()
.get(&receipt_signer)
.map_or(false, |balance| balance > &U256::zero())
{
return Err(anyhow!(
"Receipt sender `{}` is not eligible for this indexer",
Expand Down

0 comments on commit 4e19bbd

Please sign in to comment.