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
2020-01-09 19:00:57 +01:00
committed by Gavin Wood
parent 6d8b99cf5e
commit 6e572a9477
4 changed files with 157 additions and 119 deletions
+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 => {},