Replace assert with null-check during nodeid handshake (#1866)

This commit is contained in:
cryptocode 2019-03-26 21:05:13 +01:00 committed by GitHub
commit e3d97cffcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,10 +428,11 @@ public:
validated_response = true;
if (message_a.response->first != node.node_id.pub)
{
node.network.udp_channels.insert (endpoint, message_a.header.version_using);
auto channel (node.network.udp_channels.channel (endpoint));
assert (channel != nullptr);
channel->node_id = message_a.response->first;
auto channel (node.network.udp_channels.insert (endpoint, message_a.header.version_using));
if (channel)
{
channel->node_id = message_a.response->first;
}
}
}
else if (node.config.logging.network_node_id_handshake_logging ())