Skip to content

Commit

Permalink
Make transaction_indexes allocation conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Dec 18, 2024
1 parent 427736f commit 08536f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ use {
solana_transaction_status::token_balances::TransactionTokenBalancesSet,
solana_vote::vote_account::VoteAccountsHashMap,
std::{
borrow::Cow,
collections::{HashMap, HashSet},
num::Saturating,
ops::{Index, Range},
Expand Down Expand Up @@ -162,7 +163,7 @@ pub fn execute_batch(
transaction_indexes,
} = batch;
let record_token_balances = transaction_status_sender.is_some();
let mut transaction_indexes = transaction_indexes.to_vec();
let mut transaction_indexes = Cow::from(transaction_indexes);

let mut mint_decimals: HashMap<Pubkey, u8> = HashMap::new();

Expand All @@ -179,7 +180,7 @@ pub fn execute_batch(
.inspect(|&maybe_index| {
if let Some(index) = maybe_index {
assert!(transaction_indexes.is_empty());
transaction_indexes.push(index);
transaction_indexes.to_mut().push(index);
}
})
.is_some()
Expand Down Expand Up @@ -251,7 +252,7 @@ pub fn execute_batch(
commit_results,
balances,
token_balances,
transaction_indexes,
transaction_indexes.into_owned(),
);
}

Expand Down

0 comments on commit 08536f0

Please sign in to comment.