From 25e411639355fce3588325c8f9170e222ccc2245 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 16 Jan 2017 10:06:28 +0100 Subject: [PATCH] do not crash tx.serialize if pubkeys are missing. fix #2113 --- lib/transaction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/transaction.py b/lib/transaction.py index a0f8378f0..d7b330e8e 100644 --- a/lib/transaction.py +++ b/lib/transaction.py @@ -584,7 +584,9 @@ class Transaction: pubkeys = txin['x_pubkeys'] sig_list = ((sig + '01') if sig else NO_SIGNATURE for sig in x_signatures) script = ''.join(push_script(x) for x in sig_list) - if not p2sh: + if not pubkeys: + pass + elif not p2sh: x_pubkey = pubkeys[0] if x_pubkey is None: addrtype, h160 = bc_address_to_hash_160(txin['address'])