nodes fix

pull/1/head
DiMartinoXBMC 2015-08-05 18:11:37 +03:00
parent ce42965672
commit e35dc7a06d
1 changed files with 1 additions and 5 deletions

View File

@ -543,11 +543,7 @@ class Libtorrent:
result=result+'Trackers: verified %d/%d, fails=%d' %(verified_sum, len(trackers)-1, fails_sum) result=result+'Trackers: verified %d/%d, fails=%d' %(verified_sum, len(trackers)-1, fails_sum)
if info=='dht_state': if info=='dht_state':
is_dht_running='ON' if self.session.is_dht_running() else 'OFF' is_dht_running='ON' if self.session.is_dht_running() else 'OFF'
try: nodes=0
nodes=self.session.dht_state().get('nodes')
except:
nodes=self.session.status().get('nodes_num')
nodes=len(nodes) if nodes else 0
result='DHT: %s (%d)' % (is_dht_running, nodes) result='DHT: %s (%d)' % (is_dht_running, nodes)
return result return result