Browse Source

trying to improve torrent connectivity in the long run: relax peer banning.

don't preserve banned_list on startup. peers could have been banned due to changes in
block chain (invalid key or height). we shouldn't keep them banned forever.
somewhat related to #15.
miguelfreitas
Miguel Freitas 11 years ago
parent
commit
85be748663
  1. 7
      libtorrent/src/torrent.cpp

7
libtorrent/src/torrent.cpp

@ -1716,7 +1716,10 @@ namespace libtorrent
{ {
policy::peer* p = m_policy.add_peer(read_v4_endpoint<tcp::endpoint>(ptr) policy::peer* p = m_policy.add_peer(read_v4_endpoint<tcp::endpoint>(ptr)
, id, peer_info::resume_data, 0); , id, peer_info::resume_data, 0);
/* [MF] relax peer banning: don't preserve on startup. peers could have been banned due to
* changes in block chain (invalid key or height). we shouldn't keep them banned forever.
if (p) m_policy.ban_peer(p); if (p) m_policy.ban_peer(p);
*/
} }
} }
@ -1740,7 +1743,9 @@ namespace libtorrent
{ {
policy::peer* p = m_policy.add_peer(read_v6_endpoint<tcp::endpoint>(ptr) policy::peer* p = m_policy.add_peer(read_v6_endpoint<tcp::endpoint>(ptr)
, id, peer_info::resume_data, 0); , id, peer_info::resume_data, 0);
/* [MF] relax peer banning: see above
if (p) m_policy.ban_peer(p); if (p) m_policy.ban_peer(p);
*/
} }
} }
#endif #endif
@ -1776,7 +1781,9 @@ namespace libtorrent
tcp::endpoint a(address::from_string(ip, ec), (unsigned short)port); tcp::endpoint a(address::from_string(ip, ec), (unsigned short)port);
if (ec) continue; if (ec) continue;
policy::peer* p = m_policy.add_peer(a, id, peer_info::resume_data, 0); policy::peer* p = m_policy.add_peer(a, id, peer_info::resume_data, 0);
/* [MF] relax peer banning: see above
if (p) m_policy.ban_peer(p); if (p) m_policy.ban_peer(p);
*/
} }
} }
} }

Loading…
Cancel
Save