From aa46dda4719e1e7046e793e625094e0465c7df2a Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Thu, 8 Aug 2024 01:45:54 +0000 Subject: [PATCH] fix account found --- svm/src/account_loader.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/svm/src/account_loader.rs b/svm/src/account_loader.rs index 5405ac69ceb5b2..966de14867f689 100644 --- a/svm/src/account_loader.rs +++ b/svm/src/account_loader.rs @@ -209,22 +209,21 @@ fn load_transaction_accounts( .unique() .collect::>(); - let mut collect_account = - |key: &Pubkey, account_size: usize, account: AccountSharedData, rent: u64| -> Result<()> { - accumulate_and_check_loaded_account_data_size( - &mut accumulated_accounts_data_size, - account_size, - tx_details.compute_budget_limits.loaded_accounts_bytes, - error_metrics, - )?; - - tx_rent += rent; - rent_debits.insert(key, rent, account.lamports()); - - accounts.push((*key, account)); - accounts_found.push(true); - Ok(()) - }; + let mut collect_account = |key, account_size, account, rent, account_found| -> Result<()> { + accumulate_and_check_loaded_account_data_size( + &mut accumulated_accounts_data_size, + account_size, + tx_details.compute_budget_limits.loaded_accounts_bytes, + error_metrics, + )?; + + tx_rent += rent; + rent_debits.insert(key, rent, account.lamports()); + + accounts.push((*key, account)); + accounts_found.push(account_found); + Ok(()) + }; // Since the fee payer is always the first account, collect it first. Note // that account overrides are already applied during fee payer validation so @@ -235,6 +234,7 @@ fn load_transaction_accounts( tx_details.fee_payer_account.data().len(), tx_details.fee_payer_account, tx_details.fee_payer_rent_debit, + true, // account_found )?; // Attempt to load and collect remaining non-fee payer accounts @@ -296,7 +296,7 @@ fn load_transaction_accounts( }) }; - collect_account(key, account_size, account, rent)?; + collect_account(key, account_size, account, rent, account_found)?; } let builtins_start_index = accounts.len();