strip addresses before use rather than saying invalid characters
This commit is contained in:
parent
58175b90e7
commit
b204de9949
|
@ -122,14 +122,8 @@ def encodeAddress(version,stream,ripe):
|
||||||
def decodeAddress(address):
|
def decodeAddress(address):
|
||||||
#returns (status, address version number, stream number, data (almost certainly a ripe hash))
|
#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
|
address = str(address).strip()
|
||||||
if address[:3] != 'BM-':
|
|
||||||
status = 'missingbm'
|
|
||||||
return status,0,0,0
|
|
||||||
#take off the BM-
|
|
||||||
integer = decodeBase58(address[3:])"""
|
|
||||||
|
|
||||||
#changed Bitmessage to accept addresses that lack the "BM-" prefix.
|
|
||||||
if address[:3] == 'BM-':
|
if address[:3] == 'BM-':
|
||||||
integer = decodeBase58(address[3:])
|
integer = decodeBase58(address[3:])
|
||||||
else:
|
else:
|
||||||
|
@ -189,6 +183,7 @@ def decodeAddress(address):
|
||||||
return status,addressVersionNumber,streamNumber,'\x00\x00'+data[bytesUsedByVersionNumber+bytesUsedByStreamNumber:-4]
|
return status,addressVersionNumber,streamNumber,'\x00\x00'+data[bytesUsedByVersionNumber+bytesUsedByStreamNumber:-4]
|
||||||
|
|
||||||
def addBMIfNotPresent(address):
|
def addBMIfNotPresent(address):
|
||||||
|
address = str(address).strip()
|
||||||
if address[:3] != 'BM-':
|
if address[:3] != 'BM-':
|
||||||
return 'BM-'+address
|
return 'BM-'+address
|
||||||
else:
|
else:
|
||||||
|
|
Reference in New Issue
Block a user