From fc5eb9f7a70735664e338322ca37f0560e245676 Mon Sep 17 00:00:00 2001 From: WizardOfOzzie Date: Sat, 24 Oct 2015 12:27:47 +1100 Subject: [PATCH] Update transaction.py Fixes edge case where SIGHASH_ALL = 0 instead of 1 --- bitcoin/transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitcoin/transaction.py b/bitcoin/transaction.py index abc689a0..988d1055 100644 --- a/bitcoin/transaction.py +++ b/bitcoin/transaction.py @@ -197,7 +197,7 @@ def is_bip66(sig): def txhash(tx, hashcode=None): if isinstance(tx, str) and re.match('^[0-9a-fA-F]*$', tx): tx = changebase(tx, 16, 256) - if hashcode: + if hashcode is not None: return dbl_sha256(from_string_to_bytes(tx) + encode(int(hashcode), 256, 4)[::-1]) else: return safe_hexlify(bin_dbl_sha256(tx)[::-1])