Fixed test block conditions (#3332)

This commit is contained in:
Arkadiy Paronyan
2019-08-08 01:01:16 +02:00
committed by Bastian Köcher
parent 58bd0d4c05
commit c0fd256c01
4 changed files with 18 additions and 2 deletions
+3
View File
@@ -591,6 +591,9 @@ pub trait TestNetFactory: Sized {
// Return `NotReady` if there's a mismatch in the highest block number.
let mut highest = None;
for peer in self.peers().iter() {
if peer.is_major_syncing() || peer.network.num_queued_blocks() != 0 {
return Async::NotReady
}
match (highest, peer.client.info().chain.best_number) {
(None, b) => highest = Some(b),
(Some(ref a), ref b) if a == b => {},