Aggregate chains by network_id (#234)

* Aggregate chains by network_id

* Fix network_id handling
This commit is contained in:
Maciej Hirsz
2020-03-19 16:29:24 +01:00
committed by GitHub
parent d824851a96
commit d492b85091
6 changed files with 178 additions and 55 deletions
+3 -3
View File
@@ -82,11 +82,11 @@ impl NodeConnector {
}
if let Details::SystemConnected(connected) = msg.details {
let SystemConnected { chain, node } = connected;
let SystemConnected { network_id, node } = connected;
let rec = ctx.address().recipient();
let chain = chain.into();
let network_id = network_id.map(Into::into);
self.aggregator.do_send(AddNode { rec, chain, node });
self.aggregator.do_send(AddNode { rec, network_id, node });
} else {
if self.backlog.len() >= 10 {
self.backlog.remove(0);
+1 -1
View File
@@ -56,7 +56,7 @@ pub enum Details {
#[derive(Deserialize, Debug)]
pub struct SystemConnected {
pub chain: Box<str>,
pub network_id: Option<Box<str>>,
#[serde(flatten)]
pub node: NodeDetails,
}