From c9e2b88920d7ca4658288660ebfb3c4e5ae37d5e Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 28 Oct 2013 19:42:36 -0200 Subject: [PATCH] try another improvement to local dht tracker updating: currently connected nodes or recently connected (4 hours) --- libtorrent/src/torrent.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index 784fc626..475b7ce9 100644 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -2069,8 +2069,9 @@ namespace libtorrent for (; i != end; ++i) { policy::peer const* p = *i; - if( p->connectable && !p->banned && p->last_connected && - int(p->failcount) < settings().max_failcount ) { + bool connect_recently = !p->banned && int(p->failcount) < settings().max_failcount && + p->last_connected && (m_ses.session_time() - p->last_connected) < (4*3600); + if( p->connectable && ( p->connection || connect_recently) ) { m_ses.m_dht->announce(name(), m_torrent_file->info_hash() , p->address(), p->port, p->seed, false , boost::bind(&nop));