improved uploading and fixed announce
parent
e60503771e
commit
4882a21b6a
|
@ -436,4 +436,9 @@ class API:
|
|||
return False
|
||||
|
||||
def getUptime(self):
|
||||
return self._utils.getEpoch() - self.startTime
|
||||
while True:
|
||||
try:
|
||||
return self._utils.getEpoch - startTime
|
||||
except AttributeError:
|
||||
# Don't error on race condition with startup
|
||||
pass
|
|
@ -574,7 +574,7 @@ class OnionrCommunicatorDaemon:
|
|||
logger.warn('Requested to upload invalid block')
|
||||
self.decrementThreadCount('uploadBlock')
|
||||
return
|
||||
for i in range(max(len(self.onlinePeers), 2)):
|
||||
for i in range(min(len(self.onlinePeers), 6)):
|
||||
peer = self.pickOnlinePeer()
|
||||
if peer in triedPeers:
|
||||
continue
|
||||
|
@ -590,7 +590,6 @@ class OnionrCommunicatorDaemon:
|
|||
if not self._core._utils.doPostRequest(url, data=data, proxyType=proxyType) == False:
|
||||
self._core._utils.localCommand('waitforshare/' + bl)
|
||||
finishedUploads.append(bl)
|
||||
break
|
||||
for x in finishedUploads:
|
||||
try:
|
||||
self.blocksToUpload.remove(x)
|
||||
|
|
|
@ -34,7 +34,7 @@ class DaemonTools:
|
|||
'''Announce our node to our peers'''
|
||||
retData = False
|
||||
announceFail = False
|
||||
if self.daemon._core.config('general.security_level') == 0:
|
||||
if self.daemon._core.config.get('general.security_level', 0) == 0:
|
||||
# Announce to random online peers
|
||||
for i in self.daemon.onlinePeers:
|
||||
if not i in self.announceCache:
|
||||
|
|
Loading…
Reference in New Issue