fix: set sync state at startup to idle (#2722)

This commit is contained in:
Dan Cline
2023-05-17 16:32:56 -04:00
committed by GitHub
parent 352b55dc05
commit a40b79e193
3 changed files with 2 additions and 7 deletions

View File

@ -700,11 +700,6 @@ where
block_hash,
));
// Update the network sync state to `Idle`.
// Handles the edge case where the pipeline is never triggered, because we
// are sufficiently synced.
self.sync_state_updater.update_sync_state(SyncState::Idle);
PayloadStatusEnum::Valid
}
BlockStatus::Accepted => {

View File

@ -54,7 +54,7 @@ impl NetworkHandle {
peers,
network_mode,
bandwidth_meter,
is_syncing: Arc::new(AtomicBool::new(true)),
is_syncing: Arc::new(AtomicBool::new(false)),
chain_id,
};
Self { inner: Arc::new(inner) }

View File

@ -28,7 +28,7 @@ async fn test_is_default_syncing() {
.listener_port(0)
.build(NoopProvider::default());
let network = NetworkManager::new(config).await.unwrap();
assert!(network.handle().is_syncing());
assert!(!network.handle().is_syncing());
}
#[tokio::test(flavor = "multi_thread")]