Remove typeid use in network_address

Since I had to add an ID to the derived classes anyway,
this can be used instead. This removes an apparently
pointless warning from CLANG too.
This commit is contained in:
moneromooo-monero 2017-06-28 09:00:29 +01:00
parent 0c6ea4f8a6
commit 8f96cfc20a
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
6 changed files with 17 additions and 26 deletions

View file

@ -192,7 +192,7 @@ namespace cryptonote
cnx.host = cntxt.m_remote_address.host_str();
cnx.ip = "";
cnx.port = "";
if (cntxt.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address))
if (cntxt.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID)
{
cnx.ip = cnx.host;
cnx.port = std::to_string(cntxt.m_remote_address.as<epee::net_utils::ipv4_network_address>().port());