Don't call runtime if pool is empty. (#1283)

This commit is contained in:
Tomasz Drwięga
2018-12-19 10:21:46 +01:00
committed by Svyatoslav Nikolsky
parent 0c32567c1c
commit eba9d1e0a4
2 changed files with 12 additions and 1 deletions
@@ -294,6 +294,13 @@ pub struct Status {
pub future: usize,
}
impl Status {
/// Returns true if the are no transactions in the pool.
pub fn is_empty(&self) -> bool {
self.ready == 0 && self.future == 0
}
}
#[cfg(test)]
mod tests {
use super::*;