From 4672f607e5c30e31bcdd5d2224e26ec868eeac34 Mon Sep 17 00:00:00 2001 From: JahPowerBit Date: Sat, 3 Jan 2015 11:57:36 +0000 Subject: [PATCH] fix scriptpubkey_to_canonical_address --- lib/blockchain.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/blockchain.py b/lib/blockchain.py index 579e17a1..b58d364c 100644 --- a/lib/blockchain.py +++ b/lib/blockchain.py @@ -352,8 +352,10 @@ def scriptpubkey_to_canonical_address(scriptpubkey): signatures_required = asm[0] signatures_possible = len(asm) - 3 return "_".join([str(signatures_required)] + sorted(scriptpubkey['addresses']) + [str(signatures_possible)]) - else: + elif 'addresses' in scriptpubkey: return scriptpubkey['addresses'][0] + else: + return None def get_unspent_txouts(source, return_confirmed=False):