From e2071c1d1984cfa12e397c46ec2bd8ef215361c0 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Wed, 24 Jul 2024 17:03:07 +0200 Subject: [PATCH] fix: ignore product without price on polling --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/agent/state/oracle.rs | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b14e6a..4bbc46f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3400,7 +3400,7 @@ dependencies = [ [[package]] name = "pyth-agent" -version = "2.10.1" +version = "2.10.2" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index f4fc094..744d993 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-agent" -version = "2.10.1" +version = "2.10.2" edition = "2021" [[bin]] diff --git a/src/agent/state/oracle.rs b/src/agent/state/oracle.rs index eb4b0ae..eba3b96 100644 --- a/src/agent/state/oracle.rs +++ b/src/agent/state/oracle.rs @@ -521,7 +521,13 @@ async fn fetch_batch_of_product_and_price_accounts( // the product entries let mut todo = product_entries .values() - .map(|p| p.account_data.px_acc) + .filter_map(|p| { + if p.account_data.px_acc != Pubkey::default() { + Some(p.account_data.px_acc) + } else { + None + } + }) .collect::>(); while !todo.is_empty() {