sleep for 10s in syncer when not syncing (#1705)

This commit is contained in:
Antioch Peverell 2018-10-09 21:50:55 +01:00 committed by GitHub
parent 01735544ac
commit 4a1e3c27bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -124,9 +124,10 @@ fn sync_loop(
highest_height = most_work_height;
}
// quick short-circuit if no syncing is needed
// quick short-circuit (and a decent sleep) if no syncing is needed
if !syncing {
sync_state.update(SyncStatus::NoSync);
thread::sleep(time::Duration::from_secs(10));
continue;
}