mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 15:41:02 +00:00
Relaying tx/blocks by light clients (#190)
* do not import external transactions into light tx pool * do not announce blocks on light clients * blocks_are_not_announced_by_light_nodes
This commit is contained in:
committed by
Gav Wood
parent
8e2f0274e6
commit
293dca6078
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::time::{Duration, Instant};
|
||||
use futures::stream::Stream;
|
||||
use service::Service;
|
||||
use service::{Service, Components};
|
||||
use tokio_core::reactor;
|
||||
use network::{SyncState, SyncProvider};
|
||||
use polkadot_primitives::Block;
|
||||
@@ -28,11 +28,10 @@ use client::{self, BlockchainEvents};
|
||||
const TIMER_INTERVAL_MS: u64 = 5000;
|
||||
|
||||
/// Spawn informant on the event loop
|
||||
pub fn start<B, E>(service: &Service<B, E>, handle: reactor::Handle)
|
||||
pub fn start<C>(service: &Service<C>, handle: reactor::Handle)
|
||||
where
|
||||
B: client::backend::Backend<Block> + Send + Sync + 'static,
|
||||
E: client::CallExecutor<Block> + Send + Sync + 'static,
|
||||
client::error::Error: From<<<B as client::backend::Backend<Block>>::State as state_machine::backend::Backend>::Error>
|
||||
C: Components,
|
||||
client::error::Error: From<<<<C as Components>::Backend as client::backend::Backend<Block>>::State as state_machine::Backend>::Error>,
|
||||
{
|
||||
let interval = reactor::Interval::new_at(Instant::now(), Duration::from_millis(TIMER_INTERVAL_MS), &handle)
|
||||
.expect("Error creating informant timer");
|
||||
|
||||
@@ -213,11 +213,10 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
|
||||
}
|
||||
}
|
||||
|
||||
fn run_until_exit<B, E>(mut core: reactor::Core, service: service::Service<B, E>, matches: &clap::ArgMatches, config: service::Configuration) -> error::Result<()>
|
||||
fn run_until_exit<C>(mut core: reactor::Core, service: service::Service<C>, matches: &clap::ArgMatches, config: service::Configuration) -> error::Result<()>
|
||||
where
|
||||
B: client::backend::Backend<Block> + Send + Sync + 'static,
|
||||
E: client::CallExecutor<Block> + Send + Sync + 'static,
|
||||
client::error::Error: From<<<B as client::backend::Backend<Block>>::State as state_machine::backend::Backend>::Error>
|
||||
C: service::Components,
|
||||
client::error::Error: From<<<<C as service::Components>::Backend as client::backend::Backend<Block>>::State as state_machine::Backend>::Error>,
|
||||
{
|
||||
let exit = {
|
||||
// can't use signal directly here because CtrlC takes only `Fn`.
|
||||
|
||||
Reference in New Issue
Block a user