MaxCoin
This commit is contained in:
parent
f5ee1f0b69
commit
e9d8e34ab4
10
lib/util.py
10
lib/util.py
@ -6,6 +6,11 @@ import binascii
|
||||
import settings
|
||||
import bitcoin_rpc
|
||||
from hashlib import sha256
|
||||
from sha3 import sha3_256
|
||||
|
||||
if settings.COINDAEMON_ALGO == 'keccak':
|
||||
import sha3
|
||||
|
||||
|
||||
def deser_string(f):
|
||||
nit = struct.unpack("<B", f.read(1))[0]
|
||||
@ -179,7 +184,10 @@ def address_to_pubkeyhash(addr):
|
||||
|
||||
ver = addr[0]
|
||||
cksumA = addr[-4:]
|
||||
cksumB = doublesha(addr[:-4])[:4]
|
||||
#TODO: We should clean this up so that it works with not Keccek implementations too.
|
||||
cksumB = sha3_256(addr[:-4]).digest()[:4]
|
||||
|
||||
#cksumB = sha3.sha3_256(addr[:-4]).digest()[:4]
|
||||
|
||||
if cksumA != cksumB:
|
||||
return None
|
||||
|
||||
Loading…
Reference in New Issue
Block a user