From 5c14ec2eb177b7026dc04f4e67a04f3fd41a46ad Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 18 Feb 2008 03:04:06 +0000 Subject: [PATCH] made fastresume data not contain failed peers --- src/torrent_handle.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp index ea96b5b1f..9a7dc33df 100755 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -596,6 +596,8 @@ namespace libtorrent policy& pol = t->get_policy(); + int max_failcount = t->settings().max_failcount; + for (policy::iterator i = pol.begin_peer() , end(pol.end_peer()); i != end; ++i) { @@ -619,6 +621,9 @@ namespace libtorrent // been banned, don't save it. if (i->second.type == policy::peer::not_connectable) continue; + // don't save peers that doesn't work + if (i->second.failcount >= max_failcount) continue; + tcp::endpoint ip = i->second.ip; entry peer(entry::dictionary_t); peer["ip"] = ip.address().to_string(ec);