made fastresume data not contain failed peers
This commit is contained in:
parent
799dd70c4e
commit
5c14ec2eb1
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue