Skip to content

Commit 0c98598

Browse files
committed
removed unnecesary wallet ids vector clon in SequentialSyncManager::handle_cfilter_message
1 parent 7f91244 commit 0c98598

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dash-spv/src/sync/sequential/message_handlers.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,9 @@ impl<
622622

623623
drop(wallet);
624624

625-
if !matched_wallet_ids.is_empty() {
625+
let matched_wallet_ids_len = matched_wallet_ids.len();
626+
627+
if matched_wallet_ids_len > 0 {
626628
// Update filter match statistics
627629
{
628630
let mut stats = self.stats.write().await;
@@ -639,7 +641,7 @@ impl<
639641
.unwrap_or_else(|| crate::types::ChainState::new());
640642

641643
// Record the filter matches
642-
chain_state.record_filter_matches(height, matched_wallet_ids.clone());
644+
chain_state.record_filter_matches(height, matched_wallet_ids);
643645

644646
// Save ChainState to persist the filter matches
645647
storage.store_chain_state(&chain_state).await.map_err(|e| {
@@ -648,15 +650,15 @@ impl<
648650

649651
tracing::debug!(
650652
"✅ Recorded {} wallet ID(s) matching at height {} to ChainState",
651-
matched_wallet_ids.len(),
653+
matched_wallet_ids_len,
652654
height
653655
);
654656
}
655657

656658
tracing::info!(
657659
"🎯 Filter match found! Requesting block {} (matched {} wallet(s))",
658660
cfilter.block_hash,
659-
matched_wallet_ids.len()
661+
matched_wallet_ids_len
660662
);
661663

662664
// Request the full block

0 commit comments

Comments
 (0)