addressGenerator fixes
- addressGenerator got stuck (introduced recently when cleaning up shutdown - do not put addresses into API return queue if API is inactive - improve translation
This commit is contained in:
parent
f9a7a5b6f2
commit
aa97b53114
|
@ -142,6 +142,7 @@ class addressGenerator(threading.Thread, StoppableThread):
|
||||||
|
|
||||||
# The API and the join and create Chan functionality
|
# The API and the join and create Chan functionality
|
||||||
# both need information back from the address generator.
|
# both need information back from the address generator.
|
||||||
|
if shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'):
|
||||||
shared.apiAddressGeneratorReturnQueue.put(address)
|
shared.apiAddressGeneratorReturnQueue.put(address)
|
||||||
|
|
||||||
shared.UISignalQueue.put((
|
shared.UISignalQueue.put((
|
||||||
|
@ -161,10 +162,8 @@ class addressGenerator(threading.Thread, StoppableThread):
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
'WARNING: You are creating deterministic address(es) using a blank passphrase. Bitmessage will do it but it is rather stupid.')
|
'WARNING: You are creating deterministic address(es) using a blank passphrase. Bitmessage will do it but it is rather stupid.')
|
||||||
if command == 'createDeterministicAddresses':
|
if command == 'createDeterministicAddresses':
|
||||||
statusbar = 'Generating ' + str(
|
|
||||||
numberOfAddressesToMake) + ' new addresses.'
|
|
||||||
shared.UISignalQueue.put((
|
shared.UISignalQueue.put((
|
||||||
'updateStatusBar', statusbar))
|
'updateStatusBar', tr.translateText("MainWindow","Generating %1 new addresses.").arg(str(numberOfAddressesToMake))))
|
||||||
signingKeyNonce = 0
|
signingKeyNonce = 0
|
||||||
encryptionKeyNonce = 1
|
encryptionKeyNonce = 1
|
||||||
listOfNewAddressesToSendOutThroughTheAPI = [
|
listOfNewAddressesToSendOutThroughTheAPI = [
|
||||||
|
@ -210,6 +209,7 @@ class addressGenerator(threading.Thread, StoppableThread):
|
||||||
# If we are joining an existing chan, let us check to make sure it matches the provided Bitmessage address
|
# If we are joining an existing chan, let us check to make sure it matches the provided Bitmessage address
|
||||||
if command == 'joinChan':
|
if command == 'joinChan':
|
||||||
if address != chanAddress:
|
if address != chanAddress:
|
||||||
|
if shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'):
|
||||||
shared.apiAddressGeneratorReturnQueue.put('chan name does not match address')
|
shared.apiAddressGeneratorReturnQueue.put('chan name does not match address')
|
||||||
saveAddressToDisk = False
|
saveAddressToDisk = False
|
||||||
if command == 'getDeterministicAddress':
|
if command == 'getDeterministicAddress':
|
||||||
|
@ -281,6 +281,7 @@ class addressGenerator(threading.Thread, StoppableThread):
|
||||||
|
|
||||||
|
|
||||||
# Done generating addresses.
|
# Done generating addresses.
|
||||||
|
if shared.safeConfigGetBoolean('bitmessagesettings', 'apienabled'):
|
||||||
if command == 'createDeterministicAddresses' or command == 'joinChan' or command == 'createChan':
|
if command == 'createDeterministicAddresses' or command == 'joinChan' or command == 'createChan':
|
||||||
shared.apiAddressGeneratorReturnQueue.put(
|
shared.apiAddressGeneratorReturnQueue.put(
|
||||||
listOfNewAddressesToSendOutThroughTheAPI)
|
listOfNewAddressesToSendOutThroughTheAPI)
|
||||||
|
@ -289,4 +290,4 @@ class addressGenerator(threading.Thread, StoppableThread):
|
||||||
else:
|
else:
|
||||||
raise Exception(
|
raise Exception(
|
||||||
"Error in the addressGenerator thread. Thread was given a command it could not understand: " + command)
|
"Error in the addressGenerator thread. Thread was given a command it could not understand: " + command)
|
||||||
shared.apiAddressGeneratorQueue.task_done()
|
shared.addressGeneratorQueue.task_done()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user