Struct ethcore::verification::queue::VerificationQueue
[−]
[src]
pub struct VerificationQueue<K: Kind> { /* fields omitted */ }
A queue of items to be verified. Sits between network or other I/O and the BlockChain
.
Keeps them in the same order as inserted, minus invalid items.
Methods
impl<K: Kind> VerificationQueue<K>
[src]
fn new(config: Config,
engine: Arc<Engine>,
message_channel: IoChannel<ClientIoMessage>,
check_seal: bool)
-> Self
engine: Arc<Engine>,
message_channel: IoChannel<ClientIoMessage>,
check_seal: bool)
-> Self
Creates a new queue instance.
fn clear(&self)
Clear the queue and stop verification activity.
fn flush(&self)
Wait for unverified queue to be empty
fn status(&self, hash: &H256) -> Status
Check if the item is currently in the queue
fn import(&self, input: K::Input) -> ImportResult
Add a block to the queue.
fn mark_as_bad(&self, hashes: &[H256])
Mark given item and all its children as bad. pauses verification until complete.
fn mark_as_good(&self, hashes: &[H256]) -> bool
Mark given item as processed. Returns true if the queue becomes empty.
fn drain(&self, max: usize) -> Vec<K::Verified>
Removes up to max
verified items from the queue
fn queue_info(&self) -> QueueInfo
Get queue status.
fn total_difficulty(&self) -> U256
Get the total difficulty of all the blocks in the queue.
fn num_verifiers(&self) -> usize
Get the current number of working verifiers.
fn collect_garbage(&self)
Optimise memory footprint of the heap fields, and adjust the number of threads to better suit the workload.
Trait Implementations
impl<K: Kind> MayPanic for VerificationQueue<K>
[src]
fn on_panic<F>(&self, closure: F) where F: OnPanicListener
closure
will be invoked whenever panic in thread is caught