add on_exit parameter to aura thread builder (#1249)

This commit is contained in:
Robert Habermeier
2018-12-11 13:43:53 +01:00
committed by GitHub
parent d28fda3d84
commit 20782baeef
+5 -2
View File
@@ -155,6 +155,7 @@ pub fn start_aura_thread<B, C, E, I, SO, Error>(
block_import: Arc<I>,
env: Arc<E>,
sync_oracle: SO,
on_exit: impl Future<Item=(),Error=()> + Send + 'static,
) where
B: Block + 'static,
C: Authorities<B> + ChainHead<B> + Send + Sync + 'static,
@@ -177,14 +178,16 @@ pub fn start_aura_thread<B, C, E, I, SO, Error>(
}
};
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");
});
}