Make peer cleanup timings smoother
This commit is contained in:
parent
e41487f80c
commit
6f8a843e49
@ -41,10 +41,8 @@ def peer_cleanup():
|
|||||||
if peerprofiles.PeerProfiles(address).score < min_score:
|
if peerprofiles.PeerProfiles(address).score < min_score:
|
||||||
keydb.removekeys.remove_address(address)
|
keydb.removekeys.remove_address(address)
|
||||||
try:
|
try:
|
||||||
if (int(epoch.get_epoch()) - int(keydb.transportinfo.get_address_info(address, 'lastConnect'))) >= 600:
|
lastConnect = int(keydb.transportinfo.get_address_info(address, 'lastConnect'))
|
||||||
expireTime = 600
|
expireTime = 86400 - int(epoch.get_epoch()) - lastConnect
|
||||||
else:
|
|
||||||
expireTime = 86400
|
|
||||||
blacklist.addToDB(address, dataType=1, expire=expireTime)
|
blacklist.addToDB(address, dataType=1, expire=expireTime)
|
||||||
except sqlite3.IntegrityError: #TODO just make sure its not a unique constraint issue
|
except sqlite3.IntegrityError: #TODO just make sure its not a unique constraint issue
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user