diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-06-28 09:00:29 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-06-28 09:11:24 +0100 |
commit | 8f96cfc20a92f00e5b87969d589c4ec360020366 (patch) | |
tree | f9a727ce5cfbb978d9bf08c98536d542ae107479 /src/p2p/net_node.inl | |
parent | Merge pull request #2111 (diff) | |
download | monero-8f96cfc20a92f00e5b87969d589c4ec360020366.tar.xz |
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.
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index c250d5185..b23090c7d 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -939,8 +939,8 @@ namespace nodetool << (last_seen_stamp ? epee::misc_utils::get_time_interval_string(time(NULL) - last_seen_stamp):"never") << ")..."); - CHECK_AND_ASSERT_MES(na.type() == typeid(epee::net_utils::ipv4_network_address), false, - "Only IPv4 addresses are supported here, got " << na.type().name()); + CHECK_AND_ASSERT_MES(na.get_type_id() == epee::net_utils::ipv4_network_address::ID, false, + "Only IPv4 addresses are supported here"); const epee::net_utils::ipv4_network_address &ipv4 = na.as<const epee::net_utils::ipv4_network_address>(); typename net_server::t_connection_context con = AUTO_VAL_INIT(con); @@ -1004,8 +1004,8 @@ namespace nodetool << (last_seen_stamp ? epee::misc_utils::get_time_interval_string(time(NULL) - last_seen_stamp):"never") << ")..."); - CHECK_AND_ASSERT_MES(na.type() == typeid(epee::net_utils::ipv4_network_address), false, - "Only IPv4 addresses are supported here, got " << na.type().name()); + CHECK_AND_ASSERT_MES(na.get_type_id() == epee::net_utils::ipv4_network_address::ID, false, + "Only IPv4 addresses are supported here"); const epee::net_utils::ipv4_network_address &ipv4 = na.as<epee::net_utils::ipv4_network_address>(); typename net_server::t_connection_context con = AUTO_VAL_INIT(con); @@ -1510,8 +1510,8 @@ namespace nodetool if(!node_data.my_port) return false; - CHECK_AND_ASSERT_MES(context.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address), false, - "Only IPv4 addresses are supported here, got " << context.m_remote_address.type().name()); + CHECK_AND_ASSERT_MES(context.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID, false, + "Only IPv4 addresses are supported here"); const epee::net_utils::network_address na = context.m_remote_address; uint32_t actual_ip = na.as<const epee::net_utils::ipv4_network_address>().ip(); @@ -1670,8 +1670,8 @@ namespace nodetool //try ping to be sure that we can add this peer to peer_list try_ping(arg.node_data, context, [peer_id_l, port_l, context, this]() { - CHECK_AND_ASSERT_MES(context.m_remote_address.type() == typeid(epee::net_utils::ipv4_network_address), void(), - "Only IPv4 addresses are supported here, got " << context.m_remote_address.type().name()); + CHECK_AND_ASSERT_MES(context.m_remote_address.get_type_id() == epee::net_utils::ipv4_network_address::ID, void(), + "Only IPv4 addresses are supported here"); //called only(!) if success pinged, update local peerlist peerlist_entry pe; const epee::net_utils::network_address na = context.m_remote_address; |