Fix - Filter condition in `filter_executable_program_accounts()` (#31371)

* Removes `!tx.message().is_writable(i)` from the filter condition in `filter_executable_program_accounts()`.

* cargo fmt
This commit is contained in:
Alexander Meißner 2023-04-27 18:38:00 +02:00 committed by GitHub
parent e5223e19c7
commit 54f1595dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 16 deletions

View File

@ -651,23 +651,19 @@ impl Accounts {
}) })
.is_some() .is_some()
{ {
tx.message() tx.message().account_keys().iter().for_each(|key| {
.account_keys() if !result.contains_key(key) {
.iter() if let Ok(index) = self.accounts_db.account_matches_owners(
.enumerate() ancestors,
.for_each(|(i, key)| { key,
if !tx.message().is_writable(i) && !result.contains_key(key) { program_owners,
if let Ok(index) = self.accounts_db.account_matches_owners( ) {
ancestors, program_owners
key, .get(index)
program_owners, .and_then(|owner| result.insert(*key, *owner));
) {
program_owners
.get(index)
.and_then(|owner| result.insert(*key, *owner));
}
} }
}); }
});
} else { } else {
// If the transaction's nonce account was not valid, and blockhash is not found, // If the transaction's nonce account was not valid, and blockhash is not found,
// the transaction will fail to process. Let's not load any programs from the // the transaction will fail to process. Let's not load any programs from the