From dd6c3563b3e88160cca44194a999b277f9ac9ee6 Mon Sep 17 00:00:00 2001 From: Theo Butler Date: Wed, 8 Nov 2023 08:50:54 -0500 Subject: [PATCH] fix: fail fast when escrow accounts are missing (#86) 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. --- common/src/tap_manager.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/common/src/tap_manager.rs b/common/src/tap_manager.rs index ebd193dd..32edd786 100644 --- a/common/src/tap_manager.rs +++ b/common/src/tap_manager.rs @@ -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",