Here's patch for a few more issues I ran into
diff --git a/lib/bitcoin.py b/lib/bitcoin.py
index c61636b..6d8ed5e 100644
--- a/lib/bitcoin.py
+++ b/lib/bitcoin.py
@@ -111,7 +111,7 @@ def serialise (inputs, destination_output=None, data_output=None, change_output=
# List of Inputs.
for i in range(len(inputs)):
txin = inputs
- s += binascii.unhexlify(txin['txid'])[::-1] # TxOutHash
+ s += binascii.unhexlify(bytes(txin['txid'], 'UTF-8'))[::-1] # TxOutHash
s += txin['vout'].to_bytes(4, byteorder='little') # TxOutIndex
# No signature.
diff --git a/lib/blocks.py b/lib/blocks.py
index 7a9985b..827a0d6 100644
--- a/lib/blocks.py
+++ b/lib/blocks.py
@@ -316,7 +316,7 @@ def get_tx_info (tx):
if not data:
asm = vout['scriptPubKey']['asm'].split(' ')
if asm[0] == 'OP_RETURN' and len(asm) == 2:
- data = binascii.unhexlify(asm[1])
+ data = binascii.unhexlify(bytes(asm[1], 'UTF-8'))
# Only look for source if data were found (or destination is UNSPENDABLE), for speed.
if not data and destination != config.UNSPENDABLE:
diff --git a/lib/btcpay.py b/lib/btcpay.py
index 7241c98..8a2501b 100644
--- a/lib/btcpay.py
+++ b/lib/btcpay.py
@@ -12,7 +12,7 @@ LENGTH = 32 + 32
def create (db, order_match_id, test=False):
tx0_hash, tx1_hash = order_match_id[:64], order_match_id[64:] # UTF‐8 encoding means that the indices are doubled.
- tx0_hash_bytes, tx1_hash_bytes = binascii.unhexlify(tx0_hash), binascii.unhexlify(tx1_hash)
+ tx0_hash_bytes, tx1_hash_bytes = binascii.unhexlify(bytes(tx0_hash, 'UTF-8')), binascii.unhexlify(bytes(tx1_hash, 'UTF-8'))
data = config.PREFIX + struct.pack(config.TXTYPE_FORMAT, ID)
data += struct.pack(FORMAT, tx0_hash_bytes, tx1_hash_bytes)