Skip to content
Snippets Groups Projects
Verified Commit f8180604 authored by Michal Kucharczyk's avatar Michal Kucharczyk
Browse files

some minor renames

parent fd964980
No related merge requests found
......@@ -257,7 +257,7 @@ where
///
/// Intended for use in unit tests.
pub fn mempool_len(&self) -> (usize, usize) {
self.mempool.len()
self.mempool.unwatched_and_watched_count()
}
/// Returns best effort set of ready transactions for given block, without executing full
......@@ -787,7 +787,7 @@ where
target: LOG_TARGET,
"update_view: {:?} xts:{:?} v:{}",
view.at,
self.mempool.len(),
self.mempool.unwatched_and_watched_count(),
self.views_count()
);
//todo: this could be collected/cached in view
......
......@@ -106,7 +106,7 @@ where
{
fn new(
tx_hash: ExtrinsicHash<ChainApi>,
rx: Fuse<CommandReceiver<ControllerCommand<ChainApi>>>,
command_receiver: Fuse<CommandReceiver<ControllerCommand<ChainApi>>>,
) -> Self {
let mut stream_map: StreamMap<BlockHash<ChainApi>, TxStatusStream<ChainApi>> =
StreamMap::new();
......@@ -115,7 +115,7 @@ where
Self {
tx_hash,
status_stream_map: futures::StreamExt::fuse(stream_map),
command_receiver: rx,
command_receiver,
terminate: false,
future_seen: false,
ready_seen: false,
......
......@@ -131,7 +131,7 @@ where
self.transactions.read().get(&hash).map(|t| t.tx.clone())
}
pub(super) fn len(&self) -> (usize, usize) {
pub(super) fn unwatched_and_watched_count(&self) -> (usize, usize) {
let transactions = self.transactions.read();
let watched_count = transactions.values().filter(|t| t.is_watched()).count();
(transactions.len() - watched_count, watched_count)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment