From 62cac72375629247cb47cebc7e9f9b240ecfce26 Mon Sep 17 00:00:00 2001 From: debris Date: Thu, 27 Jun 2019 19:34:12 +0800 Subject: [PATCH] bring back is_full() method --- ethcore/types/src/verification_queue_info.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ethcore/types/src/verification_queue_info.rs b/ethcore/types/src/verification_queue_info.rs index 7df0dd1b77a..b89cfe20c0d 100644 --- a/ethcore/types/src/verification_queue_info.rs +++ b/ethcore/types/src/verification_queue_info.rs @@ -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