From 11054020ddf61c786153f899c5407bde8ff6fae2 Mon Sep 17 00:00:00 2001 From: Alan Penner Date: Sun, 19 Jan 2014 09:13:45 -0800 Subject: [PATCH] have both script_to_address and script_to_pubkey functions --- lib/util.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/util.py b/lib/util.py index 4a823f7..4e93fec 100644 --- a/lib/util.py +++ b/lib/util.py @@ -211,15 +211,15 @@ def ser_number(n): s.append(n) return bytes(s) -if settings.COINDAEMON_Reward == 'POW': - def script_to_address(addr): - d = address_to_pubkeyhash(addr) - if not d: - raise ValueError('invalid address') - (ver, pubkeyhash) = d - return b'\x76\xa9\x14' + pubkeyhash + b'\x88\xac' -else: - def script_to_pubkey(key): - if len(key) == 66: key = binascii.unhexlify(key) - if len(key) != 33: raise Exception('Invalid Address') - return b'\x21' + key + b'\xac' +#if settings.COINDAEMON_Reward == 'POW': +def script_to_address(addr): + d = address_to_pubkeyhash(addr) + if not d: + raise ValueError('invalid address') + (ver, pubkeyhash) = d + return b'\x76\xa9\x14' + pubkeyhash + b'\x88\xac' +#else: +def script_to_pubkey(key): + if len(key) == 66: key = binascii.unhexlify(key) + if len(key) != 33: raise Exception('Invalid Address') + return b'\x21' + key + b'\xac'