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()
{
tx.message()
.account_keys()
.iter()
.enumerate()
.for_each(|(i, key)| {
if !tx.message().is_writable(i) && !result.contains_key(key) {
if let Ok(index) = self.accounts_db.account_matches_owners(
ancestors,
key,
program_owners,
) {
program_owners
.get(index)
.and_then(|owner| result.insert(*key, *owner));
}
tx.message().account_keys().iter().for_each(|key| {
if !result.contains_key(key) {
if let Ok(index) = self.accounts_db.account_matches_owners(
ancestors,
key,
program_owners,
) {
program_owners
.get(index)
.and_then(|owner| result.insert(*key, *owner));
}
});
}
});
} else {
// 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