Skip to content

Commit b05a63f

Browse files
authored
[attestation-cli] Fix corner case of product with no price (#351)
* Fix corner case of product with no price
1 parent 079f8cc commit b05a63f

File tree

1 file changed

+11
-0
lines changed
  • solana/pyth2wormhole/client/src

1 file changed

+11
-0
lines changed

solana/pyth2wormhole/client/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,17 @@ pub async fn crawl_pyth_mapping(
427427

428428
let mut price_addr = prod.px_acc.clone();
429429

430+
// the product might have no price, can happen in tilt due to race-condition, failed tx to add price, ...
431+
if price_addr == Pubkey::default() {
432+
debug!(
433+
"Found product with addr {} that has no prices. \
434+
This should not happen in a production enviornment.",
435+
prod_addr
436+
);
437+
438+
continue;
439+
}
440+
430441
// loop until the last non-zero PriceAccount.next account
431442
loop {
432443
let price_bytes = rpc_client.get_account_data(&price_addr).await?;

0 commit comments

Comments
 (0)