@@ -28,7 +28,7 @@ use crate::{
2828 db:: traits:: { HeaderStore , PeerStore } ,
2929 error:: FetchHeaderError ,
3030 network:: { peer_map:: PeerMap , LastBlockMonitor , PeerId } ,
31- FilterSyncPolicy , NodeState , RejectPayload , TxBroadcastPolicy ,
31+ NodeState , RejectPayload , TxBroadcastPolicy ,
3232} ;
3333
3434use super :: {
@@ -60,7 +60,6 @@ pub struct Node<H: HeaderStore, P: PeerStore> {
6060 dialog : Arc < Dialog > ,
6161 client_recv : Arc < Mutex < UnboundedReceiver < ClientMessage > > > ,
6262 peer_recv : Arc < Mutex < Receiver < PeerThreadMessage > > > ,
63- filter_sync_policy : Arc < RwLock < FilterSyncPolicy > > ,
6463}
6564
6665impl < H : HeaderStore , P : PeerStore > Node < H , P > {
@@ -80,7 +79,6 @@ impl<H: HeaderStore, P: PeerStore> Node<H, P> {
8079 connection_type,
8180 target_peer_size,
8281 peer_timeout_config,
83- filter_sync_policy,
8482 log_level,
8583 } = config;
8684 // Set up a communication channel between the node and client
@@ -137,7 +135,6 @@ impl<H: HeaderStore, P: PeerStore> Node<H, P> {
137135 dialog,
138136 client_recv : Arc :: new ( Mutex :: new ( crx) ) ,
139137 peer_recv : Arc :: new ( Mutex :: new ( mrx) ) ,
140- filter_sync_policy : Arc :: new ( RwLock :: new ( filter_sync_policy) ) ,
141138 } ,
142139 client,
143140 )
@@ -255,11 +252,6 @@ impl<H: HeaderStore, P: PeerStore> Node<H, P> {
255252 self . broadcast( response) . await ;
256253 }
257254 } ,
258- ClientMessage :: ContinueDownload => {
259- if let Some ( response) = self . start_filter_download( ) . await {
260- self . broadcast( response) . await
261- }
262- } ,
263255 #[ cfg( feature = "filter-control" ) ]
264256 ClientMessage :: GetBlock ( hash) => {
265257 let mut state = self . state. write( ) . await ;
@@ -477,10 +469,7 @@ impl<H: HeaderStore, P: PeerStore> Node<H, P> {
477469 chain. next_cf_header_message ( ) ,
478470 ) ) ;
479471 } else if !chain. is_filters_synced ( ) {
480- let filter_download = self . filter_sync_policy . read ( ) . await ;
481- if matches ! ( * filter_download, FilterSyncPolicy :: Continue ) {
482- return Some ( MainThreadMessage :: GetFilters ( chain. next_filter_message ( ) ) ) ;
483- }
472+ return Some ( MainThreadMessage :: GetFilters ( chain. next_filter_message ( ) ) ) ;
484473 }
485474 None
486475 }
@@ -732,22 +721,6 @@ impl<H: HeaderStore, P: PeerStore> Node<H, P> {
732721 }
733722 }
734723
735- // Continue the filter syncing process by explicit command
736- async fn start_filter_download ( & self ) -> Option < MainThreadMessage > {
737- let mut download_policy = self . filter_sync_policy . write ( ) . await ;
738- * download_policy = FilterSyncPolicy :: Continue ;
739- drop ( download_policy) ;
740- let current_state = self . state . read ( ) . await ;
741- match * current_state {
742- NodeState :: Behind => None ,
743- NodeState :: HeadersSynced => None ,
744- _ => {
745- let mut chain = self . chain . lock ( ) . await ;
746- self . next_stateful_message ( chain. deref_mut ( ) ) . await
747- }
748- }
749- }
750-
751724 // When the application starts, fetch any headers we know about from the database.
752725 async fn fetch_headers ( & self ) -> Result < ( ) , NodeError < H :: Error , P :: Error > > {
753726 crate :: log!( self . dialog, "Attempting to load headers from the database" ) ;
0 commit comments