Browse Source

yet another ThreadMaintainDHTNodes heuristic improvement

miguelfreitas
Miguel Freitas 11 years ago
parent
commit
549ba353dd
  1. 2
      libtorrent/src/session.cpp
  2. 2
      src/twister.cpp

2
libtorrent/src/session.cpp

@ -1235,7 +1235,7 @@ namespace libtorrent @@ -1235,7 +1235,7 @@ namespace libtorrent
, coalesce_writes(false)
, outgoing_ports(0,0)
, peer_tos(0)
, active_downloads(3)
, active_downloads(6)
, active_seeds(5)
, active_dht_limit(88) // don't announce more than once every 40 seconds
, active_tracker_limit(1600) // don't announce to trackers more than once every 1.125 seconds

2
src/twister.cpp

@ -258,7 +258,7 @@ void ThreadMaintainDHTNodes() @@ -258,7 +258,7 @@ void ThreadMaintainDHTNodes()
vector<CAddress> vAddr = addrman.GetAddr();
int totalNodesCandidates = (int)(vNodes.size() + vAddr.size());
if( (!dht_nodes && totalNodesCandidates) ||
dht_nodes < totalNodesCandidates / 2 ) {
(dht_nodes < 5 && totalNodesCandidates > 10) ) {
printf("ThreadMaintainDHTNodes: too few dht_nodes, trying to add some...\n");
BOOST_FOREACH(const CAddress &a, vAddr) {
std::string addr = a.ToStringIP();

Loading…
Cancel
Save