mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 07:58:02 +00:00
add on_exit parameter to aura thread builder (#1249)
This commit is contained in:
committed by
GitHub
parent
d28fda3d84
commit
20782baeef
@@ -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");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user