@@ -127,37 +127,23 @@ impl CompactFilterSync {
127
127
return Ok(());
128
128
}
129
129
}
130
- // if wallet already past filter headers, we're done
131
- if let Some(filter_headers) = info.filter_headers {
132
- if self.initial_tip.height >= filter_headers {
133
- info!("wallet({}): tip {} >= filters {}, cbf done", wallet.name(), self.initial_tip.height, filter_headers);
134
- self.state = SyncState::Synced;
135
- return Ok(());
136
- }
137
- }
138
130
if info.headers != info.blocks {
139
131
info!("Source still syncing, retrying...");
140
132
*progress = WalletProgressUpdate::new(WalletStatus::Syncing, None);
141
133
self.wait = Some(Instant::now());
142
134
return Ok(());
143
135
}
144
- if info.filters != info.filter_headers {
136
+ let filters_synced = info.filters_progress.unwrap_or(0.0) == 1.0;
137
+ if !filters_synced {
145
138
if !self.filters_queued {
146
139
source.queue_filters()?;
147
140
self.filters_queued = true;
148
141
}
149
142
150
143
info!("Filters syncing, retrying...");
151
- *progress = WalletProgressUpdate::new(WalletStatus::CbfFilterSync, Some(
152
- calc_progress(
153
- info.checkpoint.map(|c| c.height).unwrap_or(0),
154
- info.filters.unwrap_or(0),
155
- std::cmp::max(
156
- info.prune_height.unwrap_or(0),
157
- info.filter_headers.unwrap_or(0)
158
- ),
159
- )
160
- ));
144
+ *progress = WalletProgressUpdate::new(WalletStatus::CbfFilterSync,
145
+ Some(info.filters_progress.unwrap_or(0.0))
146
+ );
161
147
self.wait = Some(Instant::now());
162
148
return Ok(());
163
149
}
0 commit comments