Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
bring back is_full() method
Browse files Browse the repository at this point in the history
  • Loading branch information
debris committed Jun 27, 2019
1 parent 7dc279c commit 62cac72
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ethcore/types/src/verification_queue_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ impl VerificationQueueInfo {
/// The total size of the queues.
pub fn total_queue_size(&self) -> usize { self.unverified_queue_size + self.verified_queue_size + self.verifying_queue_size }

/// Indicates that queue is full
pub fn is_full(&self) -> bool {
self.unverified_queue_size + self.verified_queue_size + self.verifying_queue_size > self.max_queue_size ||
self.mem_used > self.max_mem_use
}

/// Indicates that queue is empty
pub fn is_empty(&self) -> bool {
self.unverified_queue_size + self.verified_queue_size + self.verifying_queue_size == 0
Expand Down

0 comments on commit 62cac72

Please sign in to comment.