From 3c79b7bf65d303c7fd16dd3814407dc490c1cb43 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Sun, 1 Dec 2013 00:45:37 -0500 Subject: [PATCH] save the tag in the inventory for your own broadcasts also --- src/bitmessageqt/__init__.py | 1 - src/class_singleWorker.py | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 2ae7d00a..df1ea4cf 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -2147,7 +2147,6 @@ class MyForm(QtGui.QMainWindow): with shared.objectProcessorQueueSizeLock: shared.objectProcessorQueueSize += len(payload) shared.objectProcessorQueue.put((objectType,payload)) - #### def loadBlackWhiteList(self): # Initialize the Blacklist or Whitelist table diff --git a/src/class_singleWorker.py b/src/class_singleWorker.py index a4f72993..62cf8308 100644 --- a/src/class_singleWorker.py +++ b/src/class_singleWorker.py @@ -386,7 +386,10 @@ class singleWorker(threading.Thread): if addressVersionNumber >= 4: doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint( addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()).digest() - payload += doubleHashOfAddressData[32:] # the tag + tag = doubleHashOfAddressData[32:] + payload += tag + else: + tag = '' if addressVersionNumber <= 3: dataToEncrypt = encodeVarint(2) # broadcast version @@ -416,6 +419,7 @@ class singleWorker(threading.Thread): addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()[:32] else: privEncryptionKey = doubleHashOfAddressData[:32] + pubEncryptionKey = pointMult(privEncryptionKey) payload += highlevelcrypto.encrypt( dataToEncrypt, pubEncryptionKey.encode('hex')) @@ -434,7 +438,7 @@ class singleWorker(threading.Thread): inventoryHash = calculateInventoryHash(payload) objectType = 'broadcast' shared.inventory[inventoryHash] = ( - objectType, streamNumber, payload, int(time.time()),'') + objectType, streamNumber, payload, int(time.time()),tag) shared.inventorySets[streamNumber].add(inventoryHash) with shared.printLock: print 'sending inv (within sendBroadcast function) for object:', inventoryHash.encode('hex')