From eb9e0d9b72c420064d0953bb770d102cc7cc4b99 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 12 Feb 2018 13:12:43 +0400 Subject: [PATCH] create coinbase transaction --- pybtc/blockchain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pybtc/blockchain.py b/pybtc/blockchain.py index 89aee37..91c87b2 100644 --- a/pybtc/blockchain.py +++ b/pybtc/blockchain.py @@ -619,7 +619,7 @@ class Block(): def calculate_commitment(self, witness = None): wtxid_list = [b"\x00" * 32,] print(len(self.transactions)) - if not (len(self.transactions) == 1 and self.transactions[0].coinbase): + if self.transactions and not (len(self.transactions) == 1 and self.transactions[0].coinbase): for tx in self.transactions[0 if not self.transactions[0].coinbase else 1:]: wtxid_list.append(tx.whash) if witness is None: