|
95 | 95 | event_rx: Some(event_rx), |
96 | 96 | mempool_state, |
97 | 97 | mempool_filter: None, |
98 | | - last_sync_state_save: Arc::new(RwLock::new(0)), |
99 | 98 | }) |
100 | 99 | } |
101 | 100 |
|
@@ -163,29 +162,6 @@ impl< |
163 | 162 | tracing::info!("📊 Sequential sync mode: filter processing handled internally"); |
164 | 163 | } |
165 | 164 |
|
166 | | - // Try to restore sync state from persistent storage |
167 | | - if self.config.enable_persistence { |
168 | | - match self.restore_sync_state().await { |
169 | | - Ok(restored) => { |
170 | | - if restored { |
171 | | - tracing::info!( |
172 | | - "✅ Successfully restored sync state from persistent storage" |
173 | | - ); |
174 | | - } else { |
175 | | - tracing::info!("No previous sync state found, starting fresh sync"); |
176 | | - } |
177 | | - } |
178 | | - Err(e) => { |
179 | | - tracing::error!("Failed to restore sync state: {}", e); |
180 | | - tracing::warn!("Starting fresh sync due to state restoration failure"); |
181 | | - // Clear any corrupted state |
182 | | - if let Err(clear_err) = self.storage.lock().await.clear_sync_state().await { |
183 | | - tracing::error!("Failed to clear corrupted sync state: {}", clear_err); |
184 | | - } |
185 | | - } |
186 | | - } |
187 | | - } |
188 | | - |
189 | 165 | // Initialize genesis block if not already present |
190 | 166 | self.initialize_genesis_block().await?; |
191 | 167 |
|
@@ -262,14 +238,6 @@ impl< |
262 | 238 | } |
263 | 239 | } |
264 | 240 |
|
265 | | - // Save sync state before shutting down |
266 | | - if let Err(e) = self.save_sync_state().await { |
267 | | - tracing::error!("Failed to save sync state during shutdown: {}", e); |
268 | | - // Continue with shutdown even if state save fails |
269 | | - } else { |
270 | | - tracing::info!("Sync state saved successfully during shutdown"); |
271 | | - } |
272 | | - |
273 | 241 | // Disconnect from network |
274 | 242 | self.network.disconnect().await?; |
275 | 243 |
|
|
0 commit comments