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]
impl<K: Kind> VerificationQueue<K>
pub fn new(
config: Config,
engine: Arc<EthEngine>,
message_channel: IoChannel<ClientIoMessage>,
check_seal: bool
) -> Self
[src]
pub fn new(
config: Config,
engine: Arc<EthEngine>,
message_channel: IoChannel<ClientIoMessage>,
check_seal: bool
) -> Self
Creates a new queue instance.
pub fn clear(&self)
[src]
pub fn clear(&self)
Clear the queue and stop verification activity.
pub fn flush(&self)
[src]
pub fn flush(&self)
Wait for unverified queue to be empty
pub fn status(&self, hash: &H256) -> Status
[src]
pub fn status(&self, hash: &H256) -> Status
Check if the item is currently in the queue
pub fn import(&self, input: K::Input) -> ImportResult
[src]
pub fn import(&self, input: K::Input) -> ImportResult
Add a block to the queue.
pub fn mark_as_bad(&self, hashes: &[H256])
[src]
pub fn mark_as_bad(&self, hashes: &[H256])
Mark given item and all its children as bad. pauses verification until complete.
pub fn mark_as_good(&self, hashes: &[H256]) -> bool
[src]
pub fn mark_as_good(&self, hashes: &[H256]) -> bool
Mark given item as processed. Returns true if the queue becomes empty.
pub fn drain(&self, max: usize) -> Vec<K::Verified>
[src]
pub fn drain(&self, max: usize) -> Vec<K::Verified>
Removes up to max
verified items from the queue
pub fn queue_info(&self) -> QueueInfo
[src]
pub fn queue_info(&self) -> QueueInfo
Get queue status.
pub fn total_difficulty(&self) -> U256
[src]
pub fn total_difficulty(&self) -> U256
Get the total difficulty of all the blocks in the queue.
pub fn num_verifiers(&self) -> usize
[src]
pub fn num_verifiers(&self) -> usize
Get the current number of working verifiers.
pub fn collect_garbage(&self)
[src]
pub 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> Drop for VerificationQueue<K>
[src]
impl<K: Kind> Drop for VerificationQueue<K>
Auto Trait Implementations
impl<K> Send for VerificationQueue<K> where
<K as Kind>::Unverified: Send,
<K as Kind>::Verified: Send,
impl<K> Send for VerificationQueue<K> where
<K as Kind>::Unverified: Send,
<K as Kind>::Verified: Send,
impl<K> Sync for VerificationQueue<K> where
<K as Kind>::Unverified: Send,
<K as Kind>::Verified: Send,
impl<K> Sync for VerificationQueue<K> where
<K as Kind>::Unverified: Send,
<K as Kind>::Verified: Send,