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

@ -736,7 +736,7 @@ namespace cryptonote
for (auto & entry : white_list)
{
if (entry.adr.type() == typeid(epee::net_utils::ipv4_network_address))
if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
res.white_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen);
else
@ -745,7 +745,7 @@ namespace cryptonote
for (auto & entry : gray_list)
{
if (entry.adr.type() == typeid(epee::net_utils::ipv4_network_address))
if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::ID)
res.gray_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen);
else