diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index c50f2638f..4cc95e20d 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1274,6 +1274,8 @@ torrentStart( tr_torrent * tor, int reloadProgress ) if( !isVerifying ) tr_verifyAdd( tor, checkAndStartCB ); + + tor->dhtAnnounceAt = time( NULL ) tr_cryptoWeakRandInt( 20 ); } tr_globalUnlock( tor->session ); diff --git a/libtransmission/tracker.c b/libtransmission/tracker.c index 0863b4341..5027c4ad2 100644 --- a/libtransmission/tracker.c +++ b/libtransmission/tracker.c @@ -979,7 +979,7 @@ trackerPulse( void * vsession ) if( tor->dhtAnnounceAt <= now ) { int rc = 1; - if( tr_torrentAllowsDHT(tor) ) + if( tor->isRunning && tr_torrentAllowsDHT(tor) ) rc = tr_dhtAnnounce(tor, 1); if(rc == 0) /* The DHT is not ready yet. Try again soon. */