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"); }); }