diff --git a/executor/src/transactions.rs b/executor/src/transactions.rs index 67216b8..523d361 100644 --- a/executor/src/transactions.rs +++ b/executor/src/transactions.rs @@ -430,6 +430,7 @@ impl TransactionBuilder { TxErrorKind::BadExternalCall | TxErrorKind::Other => { self.handle_preflight_error(tx).await } + TxErrorKind::BlockhashNotFound => Ok(tx), // Tx is ok, just need to re-sign it TxErrorKind::AlreadyProcessed => bail!("must be handled before"), } } diff --git a/executor/src/transactions/preflight_error.rs b/executor/src/transactions/preflight_error.rs index cdeb7aa..3c061c6 100644 --- a/executor/src/transactions/preflight_error.rs +++ b/executor/src/transactions/preflight_error.rs @@ -21,6 +21,7 @@ pub enum TxErrorKind { BadExternalCall, AlreadyProcessed, MissingAccount(Pubkey), + BlockhashNotFound, Other, } @@ -37,11 +38,11 @@ impl TxErrorKind { _ => (), }; - if matches!( - extract_transaction_err(&err.kind), - Some(TransactionError::AlreadyProcessed) - ) { - return Some(Self::AlreadyProcessed); + let tx_err = extract_transaction_err(&err.kind); + match tx_err { + Some(TransactionError::AlreadyProcessed) => return Some(Self::AlreadyProcessed), + Some(TransactionError::BlockhashNotFound) => return Some(Self::BlockhashNotFound), + _ => (), } if tx.is_alt() { @@ -77,6 +78,7 @@ fn extract_transaction_err(err: &ClientErrorKind) -> Option<&TransactionError> { ), .. }) => err.as_ref(), + ClientErrorKind::TransactionError(ref err) => Some(err), _ => None, } }