do not update address databases on every request
This commit is contained in:
parent
bf9b244180
commit
bd5b6a1802
6 changed files with 47 additions and 10 deletions
|
@ -224,8 +224,9 @@ class OnionrCommunicatorDaemon:
|
|||
retData = i
|
||||
break
|
||||
else:
|
||||
# if the peer's profile is not loaded, return a new one. connectNewPeer adds it the list on connect
|
||||
# if the peer's profile is not loaded, return a new one. connectNewPeer also adds it to the list on connect
|
||||
retData = onionrpeers.PeerProfiles(peer)
|
||||
self.peerProfiles.append(retData)
|
||||
return retData
|
||||
|
||||
def getUptime(self):
|
||||
|
|
|
@ -49,6 +49,7 @@ def peer_action(comm_inst, peer, action, data='', returnHeaders=False, max_resp_
|
|||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
keydb.transportinfo.set_address_info(peer, 'lastConnect', epoch.get_epoch())
|
||||
comm_inst.getPeerProfileInstance(peer).addScore(1)
|
||||
peer_profile = comm_inst.getPeerProfileInstance(peer)
|
||||
peer_profile.update_connect_time()
|
||||
peer_profile.addScore(1)
|
||||
return retData # If returnHeaders, returns tuple of data, headers. if not, just data string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue