From 7064e9a1371181ba066e8d6fc43e703b55f593be Mon Sep 17 00:00:00 2001 From: sunce86 Date: Wed, 4 May 2022 18:28:23 +0200 Subject: [PATCH] fix priority access list estimator --- crates/solver/src/settlement_access_list.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/solver/src/settlement_access_list.rs b/crates/solver/src/settlement_access_list.rs index 19d8e11df8..efc83f4e20 100644 --- a/crates/solver/src/settlement_access_list.rs +++ b/crates/solver/src/settlement_access_list.rs @@ -242,10 +242,14 @@ impl AccessListEstimating for PriorityAccessListEstimating { for (i, estimator) in self.estimators.iter().enumerate() { match estimator.estimate_access_lists(txs).await { Ok(result) => { - return Ok(result - .into_iter() - .map(|access_list| access_list.map(filter_access_list)) - .collect()) + // result is valid if access list exist for at least one of the transactions + let is_valid = result.iter().any(|access_list| access_list.is_ok()); + if is_valid { + return Ok(result + .into_iter() + .map(|access_list| access_list.map(filter_access_list)) + .collect()); + } } Err(err) => { tracing::warn!("access list estimator {} failed {:?}", i, err);