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]
fn new<F>(client: Arc<Client>,
sync_status: F,
channel: IoChannel<ClientIoMessage>,
period: u64,
history: u64)
-> Self where F: 'static + Send + Sync + Fn() -> bool
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]
fn new_blocks(&self,
imported: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: u64)
imported: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<H256>,
_: Vec<Bytes>,
_duration: u64)
fires when chain has new blocks.
fn start(&self)
fires when chain achieves active mode
fn stop(&self)
fires when chain achieves passive mode
fn broadcast(&self, _data: Vec<u8>)
fires when chain broadcasts a message
fn transactions_received(&self, _hashes: Vec<H256>, _peer_id: usize)
fires when new transactions are received from a peer