myAddressesByHash={}#The key in this dictionary is the RIPE hash which is encoded in an address and value is the address itself.
broadcastSendersForWhichImWatching={}
workerQueue=Queue.Queue()
sqlSubmitQueue=Queue.Queue()#SQLITE3 is so thread-unsafe that they won't even let you call it from different threads using your own locks. SQL objects can only be called from one thread.
sqlReturnQueue=Queue.Queue()
sqlLock=threading.Lock()
UISignalQueue=Queue.Queue()
addressGeneratorQueue=Queue.Queue()
knownNodesLock=threading.Lock()
knownNodes={}
sendDataQueues=[]#each sendData thread puts its queue in this list.
inventory={}#of objects (like msg payloads and pubkey payloads) Does not include protocol headers (the first 24 bytes of each packet).
inventoryLock=threading.Lock()#Guarantees that two receiveDataThreads don't receive and process the same message concurrently (probably sent by a malicious individual)
printLock=threading.Lock()
appdata=''#holds the location of the application data storage directory
sys.stderr.write('Major problem! When trying to decode one of your private keys, the checksum failed. Here is the PRIVATE key: %s\n'%str(WIFstring))
return""
else:
#checksum passed
ifprivkey[0]=='\x80':
returnprivkey[1:]
else:
sys.stderr.write('Major problem! When trying to decode one of your private keys, the checksum passed but the key doesn\'t begin with hex 80. Here is the PRIVATE key: %s\n'%str(WIFstring))
privEncryptionKey=decodeWalletImportFormat(config.get(addressInKeysFile,'privencryptionkey')).encode('hex')#returns a simple 32 bytes of information encoded in 64 Hex characters, or null if there was an error
iflen(privEncryptionKey)==64:#It is 32 bytes encoded as 64 hex characters
#Now, for all addresses, even version 2 addresses, we should create Cryptor objects in a dictionary which we will use to attempt to decrypt encrypted broadcast messages.
#Wen you want to command a sendDataThread to do something, like shutdown or send some data, this function puts your data into the queues for each of the sendDataThreads. The sendDataThreads are responsible for putting their queue into (and out of) the sendDataQueues list.
defbroadcastToSendDataQueues(data):
#print 'running broadcastToSendDataQueues'
forqinsendDataQueues:
q.put((data))
defflushInventory():
#Note that the singleCleanerThread clears out the inventory dictionary from time to time, although it only clears things that have been in the dictionary for a long time. This clears the inventory dictionary Now.