diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index d3d9ea307..f5ceb830b 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -490,7 +490,9 @@ bool routing_table::add_node(node_entry e) routing_table::add_node_status_t routing_table::add_node_impl(node_entry e) { +#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS INVARIANT_CHECK; +#endif // if we already have this (IP,port), don't do anything if (m_router_nodes.find(e.ep()) != m_router_nodes.end()) @@ -940,7 +942,9 @@ void routing_table::for_each_node( void routing_table::node_failed(node_id const& nid, udp::endpoint const& ep) { +#ifdef TORRENT_EXPENSIVE_INVARIANT_CHECKS INVARIANT_CHECK; +#endif // if messages to ourself fails, ignore it if (nid == m_id) return; diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index bfa401769..7085a68e9 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -4193,7 +4193,7 @@ namespace libtorrent } else { - ret = avg + deviation * 3; + ret = avg + deviation * 4; } // ret is milliseconds, the return value is seconds. Convert to