11//! Filter synchronization and management for the Dash SPV client.
22
3- #![ allow( deprecated) ]
4-
53use std:: sync:: Arc ;
64use tokio:: sync:: RwLock ;
75
86use crate :: error:: { Result , SpvError } ;
97use crate :: network:: NetworkManager ;
108use crate :: storage:: StorageManager ;
11- use crate :: sync:: SyncManager ;
9+ use crate :: sync:: sequential :: SequentialSyncManager ;
1210use crate :: types:: SpvStats ;
1311use crate :: types:: { FilterMatch , WatchItem } ;
1412
1513/// Filter synchronization manager for coordinating filter downloads and checking.
1614pub struct FilterSyncCoordinator < ' a , S : StorageManager , N : NetworkManager > {
17- sync_manager : & ' a mut SyncManager < S , N > ,
15+ sync_manager : & ' a mut SequentialSyncManager < S , N > ,
1816 storage : & ' a mut S ,
1917 network : & ' a mut N ,
2018 watch_items : & ' a Arc < RwLock < std:: collections:: HashSet < WatchItem > > > ,
@@ -27,7 +25,7 @@ impl<'a, S: StorageManager + Send + Sync + 'static, N: NetworkManager + Send + S
2725{
2826 /// Create a new filter sync coordinator.
2927 pub fn new (
30- sync_manager : & ' a mut SyncManager < S , N > ,
28+ sync_manager : & ' a mut SequentialSyncManager < S , N > ,
3129 storage : & ' a mut S ,
3230 network : & ' a mut N ,
3331 watch_items : & ' a Arc < RwLock < std:: collections:: HashSet < WatchItem > > > ,
@@ -165,10 +163,4 @@ impl<'a, S: StorageManager + Send + Sync + 'static, N: NetworkManager + Send + S
165163 let watch_items = self . watch_items . read ( ) . await ;
166164 watch_items. iter ( ) . cloned ( ) . collect ( )
167165 }
168-
169- /// Helper method to find height for a block hash.
170- async fn find_height_for_block_hash ( & self , block_hash : dashcore:: BlockHash ) -> Option < u32 > {
171- // Use the efficient reverse index
172- self . storage . get_header_height_by_hash ( & block_hash) . await . ok ( ) . flatten ( )
173- }
174166}
0 commit comments