do not update address databases on every request

This commit is contained in:
Kevin Froman 2019-08-06 16:19:26 -05:00
parent bf9b244180
commit bd5b6a1802
6 changed files with 47 additions and 10 deletions

View file

@ -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):

View file

@ -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