From 32e88495ae29ca0889b87d1f02a50e171a923cc6 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 26 Oct 2017 00:40:08 +0200 Subject: [PATCH] fix: transaction.parse_witness() for coinbase --- lib/transaction.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/transaction.py b/lib/transaction.py index afba2bba..ed411957 100644 --- a/lib/transaction.py +++ b/lib/transaction.py @@ -434,7 +434,9 @@ def parse_witness(vds, txin): txin['value'] = vds.read_uint64() n = vds.read_compact_size() w = list(bh2u(vds.read_bytes(vds.read_compact_size())) for i in range(n)) - if n > 2: + if txin['type'] == 'coinbase': + pass + elif n > 2: txin['num_sig'] = n - 2 txin['signatures'] = parse_sig(w[1:-1]) m, n, x_pubkeys, pubkeys, witnessScript = parse_redeemScript(bfh(w[-1]))