Make communication_for exit when we end a round (#313)

* Make `communication_for` exit when we end a round

* Fix compilation
This commit is contained in:
Bastian Köcher
2019-07-05 11:42:57 +02:00
committed by GitHub
parent 29ee4e8f3a
commit f1c8f5e36d
3 changed files with 27 additions and 25 deletions
+2 -1
View File
@@ -330,6 +330,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
&self,
table: Arc<SharedTable>,
authorities: &[ValidatorId],
exit: exit_future::Exit,
) -> Self::BuildTableRouter {
let parent_hash = *table.consensus_parent_hash();
let local_session_key = table.session_key();
@@ -354,7 +355,7 @@ impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
let table_router_clone = table_router.clone();
let work = table_router.checked_statements()
.for_each(move |msg| { table_router_clone.import_statement(msg); Ok(()) });
executor.spawn(work);
executor.spawn(work.select(exit).map(|_| ()).map_err(|_| ()));
table_router
});