Skip to content

Commit fb0de33

Browse files
authored
fix: Drop duplicated received filter update (#248)
This fixes an issue introduced in #211 where the `receiver_filter_heights` lock isn't released after inserting the received height, and then the same task tries to acquire the lock again just a bit below in `mark_filter_received` -> deadlock. So, #211 should have not introduced the filter height updates here since they already exist in `mark_filter_received`. Yet the stats updates introduced in the same place are legit.
1 parent b2bdf7d commit fb0de33

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

dash-spv/src/sync/message_handlers.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -629,20 +629,6 @@ impl<
629629
stats_lock.last_filter_received_time = Some(std::time::Instant::now());
630630
}
631631

632-
// Get the shared filter heights arc from stats
633-
let stats_lock = self.stats.read().await;
634-
let received_filter_heights = stats_lock.received_filter_heights.clone();
635-
drop(stats_lock); // Release the stats lock before acquiring the mutex
636-
637-
// Now lock the heights and insert
638-
let mut heights = received_filter_heights.lock().await;
639-
heights.insert(height);
640-
tracing::trace!(
641-
"📊 Recorded filter received at height {} for block {}",
642-
height,
643-
cfilter.block_hash
644-
);
645-
646632
if matches {
647633
// Update filter match statistics
648634
{

0 commit comments

Comments
 (0)