save the tag in the inventory for your own broadcasts also

master
Jonathan Warren 9 years ago
parent 44618ffcc2
commit 3c79b7bf65
  1. 1
      src/bitmessageqt/__init__.py
  2. 8
      src/class_singleWorker.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

@ -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')

Loading…
Cancel
Save