mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-04-30 15:28:02 +00:00
Set max_nodes in ChainEntry
Only add a new node if the current number of connected nodes is below the max Define "first party networks" to be: Polkadot, Kusama, Westend and Rococo. All other networks are capped to 500 nodes
This commit is contained in:
@@ -253,6 +253,7 @@ impl Handler<AddNode> for Chain {
|
||||
|
||||
fn handle(&mut self, msg: AddNode, ctx: &mut Self::Context) {
|
||||
let AddNode { node, conn_id, rec } = msg;
|
||||
log::trace!(target: "Chain::AddNode", "New node connected. Chain '{}', node count goes from {} to {}", node.chain, self.nodes.len(), self.nodes.len() + 1);
|
||||
self.increment_label_count(&node.chain);
|
||||
|
||||
let nid = self.nodes.add(Node::new(node));
|
||||
@@ -286,7 +287,7 @@ impl Chain {
|
||||
if block.height > self.best.height {
|
||||
self.best = *block;
|
||||
log::info!(
|
||||
"[{}] [{}/{}] new best block ({}) {:?}",
|
||||
"[{}] [nodes={}/feeds={}] new best block={}/{:?}",
|
||||
self.label.0,
|
||||
nodes_len,
|
||||
self.feeds.len(),
|
||||
|
||||
Reference in New Issue
Block a user