Prioritize new blocks over old forks when syncing (#4414)

* Prioritize new blocks over old forks when syncing

* Fixed some test cases
This commit is contained in:
Arkadiy Paronyan authored and Gavin Wood committed 2020-01-09 19:00:57 +01:00
1 parent 6d8b99cf5e
commit 6e572a9477
4 files changed
+157 -119

No files matched your search

+3
View File
@@ -689,6 +689,9 @@ pub trait TestNetFactory: Sized {
if peer.is_major_syncing() || peer.network.num_queued_blocks() != 0 {
return Async::NotReady
}
if peer.network.num_sync_requests() != 0 {
return Async::NotReady
}
match (highest, peer.client.info().best_hash) {
(None, b) => highest = Some(b),
(Some(ref a), ref b) if a == b => {},