-
Notifications
You must be signed in to change notification settings - Fork 221
Parachain multiplexing #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f9376c9
e373221
51fa48a
1baff28
92eae0f
54d92e9
4d8918d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,37 +98,35 @@ impl NodeConnector { | |
fn handle_message(&mut self, msg: NodeMessage, data: Bytes, ctx: &mut <Self as Actor>::Context) { | ||
let conn_id = msg.id.unwrap_or(0); | ||
|
||
let backlog = match self.multiplex.entry(conn_id).or_default() { | ||
match self.multiplex.entry(conn_id).or_default() { | ||
ConnMultiplex::Connected { nid, chain } => { | ||
chain.do_send(UpdateNode { | ||
nid: *nid, | ||
msg, | ||
raw: Some(data), | ||
}); | ||
|
||
return; | ||
} | ||
ConnMultiplex::Waiting { backlog } => backlog, | ||
}; | ||
|
||
if let Details::SystemConnected(connected) = msg.details { | ||
let SystemConnected { network_id: _, mut node } = connected; | ||
let rec = ctx.address().recipient(); | ||
|
||
// FIXME: Use genesis hash instead of names to avoid this mess | ||
match &*node.chain { | ||
"Kusama CC3" => node.chain = "Kusama".into(), | ||
"Polkadot CC1" => node.chain = "Polkadot".into(), | ||
_ => (), | ||
} | ||
|
||
self.aggregator.do_send(AddNode { rec, conn_id, node }); | ||
} else { | ||
if backlog.len() >= 10 { | ||
backlog.remove(0); | ||
ConnMultiplex::Waiting { backlog } => { | ||
if let Details::SystemConnected(connected) = msg.details { | ||
let SystemConnected { network_id: _, mut node } = connected; | ||
let rec = ctx.address().recipient(); | ||
|
||
// FIXME: Use genesis hash instead of names to avoid this mess | ||
match &*node.chain { | ||
"Kusama CC3" => node.chain = "Kusama".into(), | ||
"Polkadot CC1" => node.chain = "Polkadot".into(), | ||
_ => (), | ||
} | ||
|
||
self.aggregator.do_send(AddNode { rec, conn_id, node }); | ||
} else { | ||
if backlog.len() >= 10 { | ||
backlog.remove(0); | ||
} | ||
|
||
backlog.push(msg); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is the fix here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue was that I had a separate backlog and |
||
} | ||
} | ||
|
||
backlog.push(msg); | ||
} | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.