Fix wait_for_blocks counting blocks that didn't go through consensus (#6850)

* Initial commit

Forked at: cde60b871e
Parent branch: origin/master

* WIP

Forked at: cde60b871e
Parent branch: origin/master
This commit is contained in:
Cecile Tonglet
2020-08-07 21:21:24 +02:00
committed by GitHub
parent cde60b871e
commit 6de543538c
+5 -3
View File
@@ -384,9 +384,11 @@ where
Box::pin(async move {
while let Some(notification) = import_notification_stream.next().await {
blocks.insert(notification.hash);
if blocks.len() == count {
break;
if notification.is_new_best {
blocks.insert(notification.hash);
if blocks.len() == count {
break;
}
}
}
})