Struct ethcore::snapshot::Watcher
[−]
[src]
pub struct Watcher { /* fields omitted */ }A ChainNotify implementation which will trigger a snapshot event
at certain block numbers.
Methods
impl Watcher[src]
impl Watcherpub fn new<F>(
client: Arc<Client>,
sync_status: F,
channel: IoChannel<ClientIoMessage>,
period: u64,
history: u64
) -> Self where
F: 'static + Send + Sync + Fn() -> bool, [src]
pub fn new<F>(
client: Arc<Client>,
sync_status: F,
channel: IoChannel<ClientIoMessage>,
period: u64,
history: u64
) -> Self where
F: 'static + Send + Sync + Fn() -> bool, Create a new Watcher which will trigger a snapshot event
once every period blocks, but only after that block is
history blocks old.
Trait Implementations
impl ChainNotify for Watcher[src]
impl ChainNotify for Watcherfn new_blocks(
&self,
imported: Vec<H256>,
_: Vec<H256>,
_: ChainRoute,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: Duration
)[src]
fn new_blocks(
&self,
imported: Vec<H256>,
_: Vec<H256>,
_: ChainRoute,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: Duration
)fires when chain has new blocks.
fn start(&self)[src]
fn start(&self)fires when chain achieves active mode
fn stop(&self)[src]
fn stop(&self)fires when chain achieves passive mode
fn broadcast(&self, _message_type: ChainMessageType)[src]
fn broadcast(&self, _message_type: ChainMessageType)fires when chain broadcasts a message
fn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)[src]
fn transactions_received(&self, _txs: &[UnverifiedTransaction], _peer_id: usize)fires when new transactions are received from a peer