aboutsummaryrefslogtreecommitdiff
path: root/contrib/testgen/base58.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/testgen/base58.py')
-rw-r--r--contrib/testgen/base58.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py
index 0dbb79a707..071bc722b0 100644
--- a/contrib/testgen/base58.py
+++ b/contrib/testgen/base58.py
@@ -43,8 +43,10 @@ def b58encode(v):
# leading 0-bytes in the input become leading-1s
nPad = 0
for c in v:
- if c == 0: nPad += 1
- else: break
+ if c == 0:
+ nPad += 1
+ else:
+ break
return (__b58chars[0]*nPad) + result
@@ -98,7 +100,8 @@ def b58decode_chk(v):
def get_bcaddress_version(strAddress):
""" Returns None if strAddress is invalid. Otherwise returns integer version of address. """
addr = b58decode_chk(strAddress)
- if addr is None or len(addr)!=21: return None
+ if addr is None or len(addr)!=21:
+ return None
version = addr[0]
return ord(version)