From ecea9ffb5f6341e818436e6a7ab98d3f2ef3375d Mon Sep 17 00:00:00 2001 From: xdustinface Date: Thu, 18 Jun 2026 21:54:41 +1000 Subject: [PATCH] fix(dash-spv): prevent filter sync crash on new block after full sync When a wallet boots already fully synced, `start_download` takes its early return before assigning `processing_height`, leaving it at the initial 0. The next block that extends the chain then drives `try_create_lookahead_batches`, which falls back to `processing_height` when no batches are active and creates a lookahead batch starting at height 0. Loading filters from height 0, which were never stored under checkpoint sync, reads an empty leading segment and panics in `SegmentCache::get_items` (debug) or returns sentinel filters as real data (release). Set `processing_height` to the computed `scan_start` before the early-return check so the scan frontier is recorded on every path. The genesis case (`committed_height == 0`) keeps starting at the wallet birth height because `scan_start` already encodes that distinction. --- dash-spv/src/sync/filters/manager.rs | 52 +++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/dash-spv/src/sync/filters/manager.rs b/dash-spv/src/sync/filters/manager.rs index 2464466b2..4128333f1 100644 --- a/dash-spv/src/sync/filters/manager.rs +++ b/dash-spv/src/sync/filters/manager.rs @@ -191,6 +191,13 @@ impl self.progress.filter_header_tip_height() { // Only emit FiltersSyncComplete if we've also reached the chain tip @@ -218,7 +225,6 @@ impl