Skip to content

Commit

Permalink
fix: fail fast when escrow accounts are missing (#86)
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 authored Nov 8, 2023
1 parent 22f6f83 commit dd6c356
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 dd6c356

Please sign in to comment.