Skip to content
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

Mute denied nodes #322

Merged
merged 14 commits into from
Mar 29, 2021
Merged
Prev Previous commit
No use denying "Earth" – they renamed
Send Close frame with reason when the remote missed a heartbeat
  • Loading branch information
dvdplm committed Mar 29, 2021
commit f328b5f5d3f2c61a0621d25b9b59157fe38a07a7
6 changes: 1 addition & 5 deletions backend/src/node/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ impl NodeConnector {
// check client heartbeats
if Instant::now().duration_since(act.hb) > CLIENT_TIMEOUT {
// stop actor
ctx.close(Some(CloseReason { code: ws::CloseCode::Abnormal, description: Some("Missed heartbeat".into())}));
ctx.stop();
}
});
Expand All @@ -113,11 +114,6 @@ impl NodeConnector {
match &*node.chain {
"Kusama CC3" => node.chain = "Kusama".into(),
"Polkadot CC1" => node.chain = "Polkadot".into(),
"Earth" => {
// Temp, there is too many of them
ctx.stop();
return;
},
_ => ()
}

Expand Down