diff --git a/lib/util.py b/lib/util.py index 1c2d3e8..35a7051 100644 --- a/lib/util.py +++ b/lib/util.py @@ -6,10 +6,10 @@ import binascii import settings import bitcoin_rpc from hashlib import sha256 -from sha3 import sha3_256 if settings.COINDAEMON_ALGO == 'keccak': import sha3 + from sha3 import sha3_256 def deser_string(f): @@ -184,10 +184,12 @@ def address_to_pubkeyhash(addr): ver = addr[0] cksumA = addr[-4:] - #TODO: We should clean this up so that it works with not Keccek implementations too. - cksumB = sha3_256(addr[:-4]).digest()[:4] + if settings.COINDAEMON_ALGO != 'max': + cksumB = doublesha(addr[:-4])[:4] + #TODO: We should clean this up so that it works with not Keccek implementations too. + else: + cksumB = sha3_256(addr[:-4]).digest()[:4] - #cksumB = sha3.sha3_256(addr[:-4]).digest()[:4] if cksumA != cksumB: return None