sync: fix peer common number on block announce (#3410)

This commit is contained in:
André Silva
2019-08-15 19:47:09 +01:00
committed by Gavin Wood
parent 50896aa916
commit 6bc72cea62
+3 -3
View File
@@ -922,10 +922,10 @@ impl<B: BlockT> ChainSync<B> {
}
// We assume that the announced block is the latest they have seen, and so our common number
// is either one further ahead or it's the one they just announced, if we know about it.
if header.parent_hash() == &self.best_queued_hash || known_parent {
peer.common_number = number - One::one();
} else if known {
if known {
peer.common_number = number
} else if header.parent_hash() == &self.best_queued_hash || known_parent {
peer.common_number = number - One::one();
}
self.is_idle = false;