From ef312c6e2c519f7534bb81743e2fa6e07ce95c79 Mon Sep 17 00:00:00 2001 From: Adam Fontenot Date: Thu, 15 Aug 2013 04:26:14 -0500 Subject: [PATCH] Updated several missed references to version 3 addresses --- src/bitmessagemain.py | 16 ++++++++-------- src/bitmessageqt/__init__.py | 2 +- src/class_receiveDataThread.py | 4 ++-- src/shared.py | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index cae8daeb..7ec8ee0e 100644 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -525,8 +525,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if status == 'versiontoohigh': return 'API Error 0010: Address version number too high (or zero) in address: ' + toAddress return 'API Error 0007: Could not decode address: ' + toAddress + ' : ' + status - if addressVersionNumber < 2 or addressVersionNumber > 3: - return 'API Error 0011: The address version number currently must be 2 or 3. Others aren\'t supported. Check the toAddress.' + if addressVersionNumber < 2 or addressVersionNumber > 4: + return 'API Error 0011: The address version number currently must be 2, 3, or 4. Others aren\'t supported. Check the toAddress.' if streamNumber != 1: return 'API Error 0012: The stream number must be 1. Others aren\'t supported. Check the toAddress.' status, addressVersionNumber, streamNumber, fromRipe = decodeAddress( @@ -542,8 +542,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if status == 'versiontoohigh': return 'API Error 0010: Address version number too high (or zero) in address: ' + fromAddress return 'API Error 0007: Could not decode address: ' + fromAddress + ' : ' + status - if addressVersionNumber < 2 or addressVersionNumber > 3: - return 'API Error 0011: The address version number currently must be 2 or 3. Others aren\'t supported. Check the fromAddress.' + if addressVersionNumber < 2 or addressVersionNumber > 4: + return 'API Error 0011: The address version number currently must be 2, 3, or 4. Others aren\'t supported. Check the fromAddress.' if streamNumber != 1: return 'API Error 0012: The stream number must be 1. Others aren\'t supported. Check the fromAddress.' toAddress = addBMIfNotPresent(toAddress) @@ -607,8 +607,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if status == 'versiontoohigh': return 'API Error 0010: Address version number too high (or zero) in address: ' + fromAddress return 'API Error 0007: Could not decode address: ' + fromAddress + ' : ' + status - if addressVersionNumber < 2 or addressVersionNumber > 3: - return 'API Error 0011: the address version number currently must be 2 or 3. Others aren\'t supported. Check the fromAddress.' + if addressVersionNumber < 2 or addressVersionNumber > 4: + return 'API Error 0011: the address version number currently must be 2, 3, or 4. Others aren\'t supported. Check the fromAddress.' if streamNumber != 1: return 'API Error 0012: the stream number must be 1. Others aren\'t supported. Check the fromAddress.' fromAddress = addBMIfNotPresent(fromAddress) @@ -678,8 +678,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): if status == 'versiontoohigh': return 'API Error 0010: Address version number too high (or zero) in address: ' + address return 'API Error 0007: Could not decode address: ' + address + ' : ' + status - if addressVersionNumber < 2 or addressVersionNumber > 3: - return 'API Error 0011: The address version number currently must be 2 or 3. Others aren\'t supported.' + if addressVersionNumber < 2 or addressVersionNumber > 4: + return 'API Error 0011: The address version number currently must be 2, 3, or 4. Others aren\'t supported.' if streamNumber != 1: return 'API Error 0012: The stream number must be 1. Others aren\'t supported.' # First we must check to see if the address is already in the diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 396d0b6e..c50152c0 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -1572,7 +1572,7 @@ class MyForm(QtGui.QMainWindow): continue except: pass - if addressVersionNumber > 3 or addressVersionNumber <= 1: + if addressVersionNumber > 4 or addressVersionNumber <= 1: QMessageBox.about(self, _translate("MainWindow", "Address version number"), _translate( "MainWindow", "Concerning the address %1, Bitmessage cannot understand address version numbers of %2. Perhaps upgrade Bitmessage to the latest version.").arg(toAddress).arg(str(addressVersionNumber))) continue diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 6adfe490..fb37792b 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -1216,7 +1216,7 @@ class receiveDataThread(threading.Thread): if addressVersion == 0: print '(Within processpubkey) addressVersion of 0 doesn\'t make sense.' return - if addressVersion >= 4 or addressVersion == 1: + if addressVersion > 4 or addressVersion == 1: with shared.printLock: print 'This version of Bitmessage cannot handle version', addressVersion, 'addresses.' @@ -1273,7 +1273,7 @@ class receiveDataThread(threading.Thread): shared.sqlLock.release() # shared.workerQueue.put(('newpubkey',(addressVersion,streamNumber,ripe))) self.possibleNewPubkey(ripe) - if addressVersion == 3: + if addressVersion == 3 or addressVersion == 4: if len(data) < 170: # sanity check. print '(within processpubkey) payloadLength less than 170. Sanity check failed.' return diff --git a/src/shared.py b/src/shared.py index da83f374..e5ff8378 100644 --- a/src/shared.py +++ b/src/shared.py @@ -230,7 +230,7 @@ def reloadMyAddressHashes(): if isEnabled: hasEnabledKeys = True status,addressVersionNumber,streamNumber,hash = decodeAddress(addressInKeysFile) - if addressVersionNumber == 2 or addressVersionNumber == 3: + if addressVersionNumber == 2 or addressVersionNumber == 3 or addressVersionNumber == 4: # Returns a simple 32 bytes of information encoded in 64 Hex characters, # or null if there was an error. privEncryptionKey = decodeWalletImportFormat(