increase POW when resending objects
Automatically increase defaultpayloadlengthextrabytes when resending objects to get higher priority in the object inventories of other clients. In this way, since class_receiveDataThread.py has also been patched to order the inventory by POW strength, only low POW "spamers" will be denied service when the network is overloaded because clients trying to originate legitimate messages will automatically compute a increasingly stronger POWs until distinguishing themselves as more worthy of the network's limited resources.
This commit is contained in:
parent
13db5fe00c
commit
d669ef764f
|
@ -94,9 +94,11 @@ class singleCleaner(threading.Thread):
|
|||
toaddress, toripe, fromaddress, subject, message, ackdata, lastactiontime, status, pubkeyretrynumber, msgretrynumber = row
|
||||
if status == 'awaitingpubkey':
|
||||
if (int(time.time()) - lastactiontime) > (shared.maximumAgeOfAnObjectThatIAmWillingToAccept * (2 ** (pubkeyretrynumber))):
|
||||
shared.networkDefaultPayloadLengthExtraBytes += 14000 #increase POW for each object dropped
|
||||
resendPubkey(pubkeyretrynumber,toripe)
|
||||
else: # status == msgsent
|
||||
if (int(time.time()) - lastactiontime) > (shared.maximumAgeOfAnObjectThatIAmWillingToAccept * (2 ** (msgretrynumber))):
|
||||
shared.networkDefaultPayloadLengthExtraBytes += 14000 #increase POW for each object dropped
|
||||
resendMsg(msgretrynumber,ackdata)
|
||||
|
||||
# Let's also clear and reload shared.inventorySets to keep it from
|
||||
|
|
Reference in New Issue
Block a user