From cad57ed781d4547f2c2eb24fbf2b0736e6eba10f Mon Sep 17 00:00:00 2001 From: Kyu Crane Date: Thu, 30 Jul 2015 01:16:50 -0400 Subject: [PATCH] Implement mobile send --- src/class_singleWorker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index 327f526a..02177309 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -789,7 +789,10 @@ class singleWorker(threading.Thread): encryptedPayload = pack('>Q', embeddedTime) encryptedPayload += '\x00\x00\x00\x02' # object type: msg encryptedPayload += encodeVarint(1) # msg version - encryptedPayload += encodeVarint(toStreamNumber) + encrypted + encryptedPayload += encodeVarint(toStreamNumber) + if shared.isBitSetWithinBitfield(behaviorBitfield,30): # if receiver is a mobile device who expects that their address RIPE is included unencrypted on the front of the message.. + encryptedPayload += toRipe.lstrip('\x00') + encryptedPayload += encrypted target = 2 ** 64 / (requiredAverageProofOfWorkNonceTrialsPerByte*(len(encryptedPayload) + 8 + requiredPayloadLengthExtraBytes + ((TTL*(len(encryptedPayload)+8+requiredPayloadLengthExtraBytes))/(2 ** 16)))) with shared.printLock: print '(For msg message) Doing proof of work. Total required difficulty:', float(requiredAverageProofOfWorkNonceTrialsPerByte) / shared.networkDefaultProofOfWorkNonceTrialsPerByte, 'Required small message difficulty:', float(requiredPayloadLengthExtraBytes) / shared.networkDefaultPayloadLengthExtraBytes