From b05a63fe5a30899e8ba94acbc2bd0ba262f5f964 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Tue, 18 Oct 2022 16:32:44 +0200 Subject: [PATCH] [attestation-cli] Fix corner case of product with no price (#351) * Fix corner case of product with no price --- solana/pyth2wormhole/client/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/solana/pyth2wormhole/client/src/lib.rs b/solana/pyth2wormhole/client/src/lib.rs index 3f1263c5..098850b7 100644 --- a/solana/pyth2wormhole/client/src/lib.rs +++ b/solana/pyth2wormhole/client/src/lib.rs @@ -427,6 +427,17 @@ pub async fn crawl_pyth_mapping( let mut price_addr = prod.px_acc.clone(); + // the product might have no price, can happen in tilt due to race-condition, failed tx to add price, ... + if price_addr == Pubkey::default() { + debug!( + "Found product with addr {} that has no prices. \ + This should not happen in a production enviornment.", + prod_addr + ); + + continue; + } + // loop until the last non-zero PriceAccount.next account loop { let price_bytes = rpc_client.get_account_data(&price_addr).await?;