made fastresume data not contain failed peers

This commit is contained in:
Arvid Norberg 2008-02-18 03:04:06 +00:00
parent 799dd70c4e
commit 5c14ec2eb1
1 changed files with 5 additions and 0 deletions

View File

@ -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);