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.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/testgen/base58.py b/contrib/testgen/base58.py
index 0dbb79a707..da67cb2d90 100644
--- a/contrib/testgen/base58.py
+++ b/contrib/testgen/base58.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2012-2017 The Bitcoin Core developers
+# Copyright (c) 2012-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
@@ -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)