parent
c545e812d0
commit
4e41c81bc7
|
@ -249,7 +249,7 @@ impl ClusterInfo {
|
||||||
let nodes: Vec<_> = self
|
let nodes: Vec<_> = self
|
||||||
.all_peers()
|
.all_peers()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|node| {
|
.map(|(node, last_updated)| {
|
||||||
if !ContactInfo::is_valid_address(&node.gossip) {
|
if !ContactInfo::is_valid_address(&node.gossip) {
|
||||||
spy_nodes += 1;
|
spy_nodes += 1;
|
||||||
}
|
}
|
||||||
|
@ -266,7 +266,7 @@ impl ClusterInfo {
|
||||||
tpu: {:20} | |\n \
|
tpu: {:20} | |\n \
|
||||||
rpc: {:20} | |\n",
|
rpc: {:20} | |\n",
|
||||||
addr_to_string(&node.gossip),
|
addr_to_string(&node.gossip),
|
||||||
now.saturating_sub(node.wallclock),
|
now.saturating_sub(last_updated),
|
||||||
node.id,
|
node.id,
|
||||||
if node.id == my_id { "(me)" } else { "" }.to_string(),
|
if node.id == my_id { "(me)" } else { "" }.to_string(),
|
||||||
addr_to_string(&node.tpu),
|
addr_to_string(&node.tpu),
|
||||||
|
@ -347,14 +347,17 @@ impl ClusterInfo {
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
// All nodes in gossip, including spy nodes
|
// All nodes in gossip (including spy nodes) and the last time we heard about them
|
||||||
pub(crate) fn all_peers(&self) -> Vec<ContactInfo> {
|
pub(crate) fn all_peers(&self) -> Vec<(ContactInfo, u64)> {
|
||||||
self.gossip
|
self.gossip
|
||||||
.crds
|
.crds
|
||||||
.table
|
.table
|
||||||
.values()
|
.values()
|
||||||
.filter_map(|x| x.value.contact_info())
|
.filter_map(|x| {
|
||||||
.cloned()
|
x.value
|
||||||
|
.contact_info()
|
||||||
|
.map(|ci| (ci.clone(), x.local_timestamp))
|
||||||
|
})
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -294,7 +294,7 @@ impl RpcSol for RpcSolImpl {
|
||||||
Ok(cluster_info
|
Ok(cluster_info
|
||||||
.all_peers()
|
.all_peers()
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|contact_info| {
|
.filter_map(|(contact_info, _)| {
|
||||||
if ContactInfo::is_valid_address(&contact_info.gossip) {
|
if ContactInfo::is_valid_address(&contact_info.gossip) {
|
||||||
Some(RpcContactInfo {
|
Some(RpcContactInfo {
|
||||||
id: contact_info.id.to_string(),
|
id: contact_info.id.to_string(),
|
||||||
|
|
Loading…
Reference in New Issue