From b204de9949a01c72724f5a4659213f92a8acd673 Mon Sep 17 00:00:00 2001 From: Jonathan Warren Date: Thu, 4 Apr 2013 12:43:45 -0400 Subject: [PATCH] strip addresses before use rather than saying invalid characters --- addresses.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/addresses.py b/addresses.py index b29748aa..d3423503 100644 --- a/addresses.py +++ b/addresses.py @@ -122,14 +122,8 @@ def encodeAddress(version,stream,ripe): def decodeAddress(address): #returns (status, address version number, stream number, data (almost certainly a ripe hash)) - """#check for the BM- at the front of the address. If it isn't there, this address might be for a different version of Bitmessage - if address[:3] != 'BM-': - status = 'missingbm' - return status,0,0,0 - #take off the BM- - integer = decodeBase58(address[3:])""" + address = str(address).strip() - #changed Bitmessage to accept addresses that lack the "BM-" prefix. if address[:3] == 'BM-': integer = decodeBase58(address[3:]) else: @@ -189,6 +183,7 @@ def decodeAddress(address): return status,addressVersionNumber,streamNumber,'\x00\x00'+data[bytesUsedByVersionNumber+bytesUsedByStreamNumber:-4] def addBMIfNotPresent(address): + address = str(address).strip() if address[:3] != 'BM-': return 'BM-'+address else: