Skip to content

Commit

Permalink
fix: only count base nodes in peers count in base node status (#4039)
Browse files Browse the repository at this point in the history
Description
---
Filter connection count in status command to only count base nodes

Motivation and Context
---
We only want to show connection count to base nodes in the base node status line. Currently it counts all connected peers regarding of type.

How Has This Been Tested?
---
Manually tested by listing all connections and then comparing it to the status line to see that it filters base nodes
  • Loading branch information
mrnaveira authored Apr 29, 2022
1 parent 7032667 commit 190d75a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion applications/tari_base_node/src/commands/command/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use async_trait::async_trait;
use chrono::{DateTime, Utc};
use clap::Parser;
use tari_app_utilities::consts;
use tari_comms::connectivity::ConnectivitySelection;

use super::{CommandContext, HandleCommand};
use crate::commands::status_line::{StatusLine, StatusLineOutput};
Expand Down Expand Up @@ -93,7 +94,10 @@ impl CommandContext {
),
);

let conns = self.connectivity.get_active_connections().await?;
let conns = self
.connectivity
.select_connections(ConnectivitySelection::all_nodes(vec![]))
.await?;
status_line.add_field("Connections", conns.len());
let banned_peers = self.fetch_banned_peers().await?;
status_line.add_field("Banned", banned_peers.len());
Expand Down

0 comments on commit 190d75a

Please sign in to comment.