From 20782baeefaa36676940d2df53fcbac58c27aee9 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Tue, 11 Dec 2018 13:43:53 +0100 Subject: [PATCH] add on_exit parameter to aura thread builder (#1249) --- substrate/core/consensus/aura/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/substrate/core/consensus/aura/src/lib.rs b/substrate/core/consensus/aura/src/lib.rs index b183c6346e..dc6fd41fea 100644 --- a/substrate/core/consensus/aura/src/lib.rs +++ b/substrate/core/consensus/aura/src/lib.rs @@ -155,6 +155,7 @@ pub fn start_aura_thread( block_import: Arc, env: Arc, sync_oracle: SO, + on_exit: impl Future + Send + 'static, ) where B: Block + 'static, C: Authorities + ChainHead + Send + Sync + 'static, @@ -177,14 +178,16 @@ pub fn start_aura_thread( } }; - runtime.block_on(start_aura( + runtime.spawn(start_aura( slot_duration, local_key, client, block_import, env, sync_oracle, - )).expect("aura authorship never returns error; qed"); + )); + + runtime.block_on(on_exit).expect("Exit future should not fail"); }); }