add tx pool kernel counts to tui status page (#3111)

* add tx pool kernel counts to tui status page

* fix formatting on tui
This commit is contained in:
Antioch Peverell
2019-11-14 16:21:27 +00:00
committed by GitHub
parent a1061f09a8
commit 8d2c43d7e8
4 changed files with 39 additions and 12 deletions
+6
View File
@@ -446,6 +446,12 @@ impl Pool {
self.entries.len()
}
/// Number of transaction kernels in the pool.
/// This may differ from the size (number of transactions) due to tx aggregation.
pub fn kernel_count(&self) -> usize {
self.entries.iter().map(|x| x.tx.kernels().len()).sum()
}
/// Is the pool empty?
pub fn is_empty(&self) -> bool {
self.entries.is_empty()