From 7204bb40bfa78de9cb47170b5f471bb05241399c Mon Sep 17 00:00:00 2001 From: Pankaj Garg Date: Mon, 21 Jan 2019 15:26:06 -0800 Subject: [PATCH] Don't fail process_entries with ProgramErrors (#2509) --- src/bank.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/bank.rs b/src/bank.rs index 155522901d..4e5066d5d3 100644 --- a/src/bank.rs +++ b/src/bank.rs @@ -659,11 +659,22 @@ impl Bank { let results: Vec> = entries .into_par_iter() .map(|(e, lock_results)| { - let results = self.load_execute_and_commit_transactions( + let old_results = self.load_execute_and_commit_transactions( &e.transactions, lock_results.to_vec(), MAX_ENTRY_IDS, ); + let mut results = Vec::new(); + results.reserve(old_results.len()); + results = old_results + .into_iter() + .map(|result| match result { + // Entries that result in a ProgramError are still valid and are written in the + // ledger so map them to an ok return value + Err(BankError::ProgramError(_, _)) => Ok(()), + _ => result, + }) + .collect(); self.unlock_accounts(&e.transactions, &results); Self::first_err(&results) })