From 2ebb24bac6e13b66f2f9f2680850fd8e4bf035a2 Mon Sep 17 00:00:00 2001 From: ahmedbodi Date: Thu, 27 Feb 2014 11:17:34 +0000 Subject: [PATCH] MaxCoin Main Fixes --- lib/util.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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