Count compute units even when transaction errors (backport #22059) (#22154)

* Count compute units even when transaction errors (#22059)

(cherry picked from commit eaa8c67bde)

# Conflicts:
#	program-runtime/src/invoke_context.rs
#	runtime/src/bank.rs
#	runtime/src/message_processor.rs

* Fix merge conflicts

Co-authored-by: carllin <carl@solana.com>
This commit is contained in:
mergify[bot]
2021-12-29 08:04:12 +00:00
committed by GitHub
parent 14ed446923
commit 401c542d2a
13 changed files with 305 additions and 93 deletions

View File

@@ -102,10 +102,10 @@ thread_local!(static PAR_THREAD_POOL: RefCell<ThreadPool> = RefCell::new(rayon::
.unwrap())
);
fn first_err(results: &[Result<()>]) -> Result<()> {
fn first_err<T>(results: &[Result<T>]) -> Result<()> {
for r in results {
if r.is_err() {
return r.clone();
if let Err(e) = r {
return Err(e.clone());
}
}
Ok(())