Make health iteration code work with pyth oracles
They have a different account owner, that error must be skipped.
This commit is contained in:
parent
36729ad008
commit
84e9cbd030
|
@ -90,7 +90,8 @@ pub fn margin_trade<'key, 'accounts, 'remaining, 'info>(
|
||||||
allowed_banks.insert(ai.key, bank);
|
allowed_banks.insert(ai.key, bank);
|
||||||
}
|
}
|
||||||
Err(Error::AnchorError(error))
|
Err(Error::AnchorError(error))
|
||||||
if error.error_code_number == ErrorCode::AccountDiscriminatorMismatch as u32 =>
|
if error.error_code_number == ErrorCode::AccountDiscriminatorMismatch as u32
|
||||||
|
|| error.error_code_number == ErrorCode::AccountOwnedByWrongProgram as u32 =>
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,9 @@ impl<'a, 'b> ScanningAccountRetriever<'a, 'b> {
|
||||||
}
|
}
|
||||||
Err(Error::AnchorError(error))
|
Err(Error::AnchorError(error))
|
||||||
if error.error_code_number
|
if error.error_code_number
|
||||||
== ErrorCode::AccountDiscriminatorMismatch as u32 =>
|
== ErrorCode::AccountDiscriminatorMismatch as u32
|
||||||
|
|| error.error_code_number
|
||||||
|
== ErrorCode::AccountOwnedByWrongProgram as u32 =>
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue