[attestation-cli] Fix corner case of product with no price (#351)

* Fix corner case of product with no price
This commit is contained in:
Ali Behjati 2022-10-18 16:32:44 +02:00 committed by GitHub
parent 079f8cc0b7
commit b05a63fe5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -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?;