From d669ef764f132cc916dea4589fbf3942c0edf3d1 Mon Sep 17 00:00:00 2001 From: a3284642 Date: Fri, 19 Sep 2014 01:57:32 +0000 Subject: [PATCH] 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. --- src/class_singleCleaner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class_singleCleaner.py b/src/class_singleCleaner.py index 74ecedac..6e06967b 100644 --- a/src/class_singleCleaner.py +++ b/src/class_singleCleaner.py @@ -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