diff --git a/core/src/sample_performance_service.rs b/core/src/sample_performance_service.rs index a82b433450..5f5b9b6655 100644 --- a/core/src/sample_performance_service.rs +++ b/core/src/sample_performance_service.rs @@ -51,18 +51,19 @@ impl SamplePerformanceService { blockstore: &Arc, exit: Arc, ) { - let (bank, highest_slot) = { + let mut snapshot = { let forks = bank_forks.read().unwrap(); - (forks.root_bank(), forks.highest_slot()) - }; + let bank = forks.root_bank(); + let highest_slot = forks.highest_slot(); - // Store the absolute transaction counts to that we can compute the - // difference between these values at points in time to figure out - // how many transactions occurred in that timespan. - let mut snapshot = SamplePerformanceSnapshot { - num_transactions: bank.transaction_count(), - num_non_vote_transactions: bank.non_vote_transaction_count_since_restart(), - highest_slot, + // Store the absolute transaction counts to that we can compute the + // difference between these values at points in time to figure out + // how many transactions occurred in that timespan. + SamplePerformanceSnapshot { + num_transactions: bank.transaction_count(), + num_non_vote_transactions: bank.non_vote_transaction_count_since_restart(), + highest_slot, + } }; let mut now = Instant::now();