save the tag in the inventory for your own broadcasts also

This commit is contained in:
Jonathan Warren 2013-12-01 00:45:37 -05:00
parent 44618ffcc2
commit 3c79b7bf65
2 changed files with 6 additions and 3 deletions

View File

@ -2147,7 +2147,6 @@ class MyForm(QtGui.QMainWindow):
with shared.objectProcessorQueueSizeLock: with shared.objectProcessorQueueSizeLock:
shared.objectProcessorQueueSize += len(payload) shared.objectProcessorQueueSize += len(payload)
shared.objectProcessorQueue.put((objectType,payload)) shared.objectProcessorQueue.put((objectType,payload))
####
def loadBlackWhiteList(self): def loadBlackWhiteList(self):
# Initialize the Blacklist or Whitelist table # Initialize the Blacklist or Whitelist table

View File

@ -386,7 +386,10 @@ class singleWorker(threading.Thread):
if addressVersionNumber >= 4: if addressVersionNumber >= 4:
doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint( doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint(
addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()).digest() addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()).digest()
payload += doubleHashOfAddressData[32:] # the tag tag = doubleHashOfAddressData[32:]
payload += tag
else:
tag = ''
if addressVersionNumber <= 3: if addressVersionNumber <= 3:
dataToEncrypt = encodeVarint(2) # broadcast version dataToEncrypt = encodeVarint(2) # broadcast version
@ -416,6 +419,7 @@ class singleWorker(threading.Thread):
addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()[:32] addressVersionNumber) + encodeVarint(streamNumber) + ripe).digest()[:32]
else: else:
privEncryptionKey = doubleHashOfAddressData[:32] privEncryptionKey = doubleHashOfAddressData[:32]
pubEncryptionKey = pointMult(privEncryptionKey) pubEncryptionKey = pointMult(privEncryptionKey)
payload += highlevelcrypto.encrypt( payload += highlevelcrypto.encrypt(
dataToEncrypt, pubEncryptionKey.encode('hex')) dataToEncrypt, pubEncryptionKey.encode('hex'))
@ -434,7 +438,7 @@ class singleWorker(threading.Thread):
inventoryHash = calculateInventoryHash(payload) inventoryHash = calculateInventoryHash(payload)
objectType = 'broadcast' objectType = 'broadcast'
shared.inventory[inventoryHash] = ( shared.inventory[inventoryHash] = (
objectType, streamNumber, payload, int(time.time()),'') objectType, streamNumber, payload, int(time.time()),tag)
shared.inventorySets[streamNumber].add(inventoryHash) shared.inventorySets[streamNumber].add(inventoryHash)
with shared.printLock: with shared.printLock:
print 'sending inv (within sendBroadcast function) for object:', inventoryHash.encode('hex') print 'sending inv (within sendBroadcast function) for object:', inventoryHash.encode('hex')