mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 21:37:56 +00:00
Small slots refactor (#2780)
* Deprecate SlotWorker::on_start * start_slot_worker no longer needs an Arc * start_slot_worker now always succeeds * Removed on_exit parameter from start_*_worker * Minor doc * Fix node-template
This commit is contained in:
committed by
DemiMarie-parity
parent
eaa0ab014a
commit
67bdfc7d8e
@@ -26,6 +26,7 @@ use consensus::{import_queue, start_aura, AuraImportQueue, SlotDuration, Nothing
|
||||
use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
|
||||
use node_executor;
|
||||
use primitives::{Pair as PairT, ed25519};
|
||||
use futures::prelude::*;
|
||||
use node_primitives::Block;
|
||||
use node_runtime::{GenesisConfig, RuntimeApi};
|
||||
use substrate_service::{
|
||||
@@ -92,7 +93,7 @@ construct_service_factory! {
|
||||
let client = service.client();
|
||||
let select_chain = service.select_chain()
|
||||
.ok_or(ServiceError::SelectChainRequired)?;
|
||||
executor.spawn(start_aura(
|
||||
let aura = start_aura(
|
||||
SlotDuration::get_or_compute(&*client)?,
|
||||
key.clone(),
|
||||
client,
|
||||
@@ -100,10 +101,10 @@ construct_service_factory! {
|
||||
block_import.clone(),
|
||||
proposer,
|
||||
service.network(),
|
||||
service.on_exit(),
|
||||
service.config.custom.inherent_data_providers.clone(),
|
||||
service.config.force_authoring,
|
||||
)?);
|
||||
)?;
|
||||
executor.spawn(aura.select(service.on_exit()).then(|_| Ok(())));
|
||||
|
||||
info!("Running Grandpa session as Authority {}", key.public());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user