Don't send event::Heartbeat to unauthenticated peers

refs #7746
This commit is contained in:
Alexander A. Klimov 2020-01-13 11:21:38 +01:00
parent cb21086d6c
commit 3d841d5f64
1 changed files with 9 additions and 7 deletions

View File

@ -36,13 +36,15 @@ void JsonRpcConnection::HandleAndWriteHeartbeats(boost::asio::yield_context yc)
break;
}
SendMessageInternal(new Dictionary({
{ "jsonrpc", "2.0" },
{ "method", "event::Heartbeat" },
{ "params", new Dictionary({
{ "timeout", 120 }
}) }
}));
if (m_Endpoint) {
SendMessageInternal(new Dictionary({
{ "jsonrpc", "2.0" },
{ "method", "event::Heartbeat" },
{ "params", new Dictionary({
{ "timeout", 120 }
}) }
}));
}
}
}