From baa45b8bad07fc1ea484783faaba7c7f4c8b027d Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Mar 2019 16:07:10 +0000 Subject: [PATCH] fix to bytearray bug on multiple transactions operations --- OP_RETURN.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OP_RETURN.py b/OP_RETURN.py index 594bc8d..941a179 100644 --- a/OP_RETURN.py +++ b/OP_RETURN.py @@ -338,9 +338,9 @@ def OP_RETURN_create_txn(inputs, outputs, metadata, metadata_pos, testnet): if metadata_len<=75: payload=bytearray((metadata_len,))+metadata # length byte + data (https://en.bitcoin.it/wiki/Script) elif metadata_len<=256: - payload="\x4c"+bytearray((metadata_len,))+metadata # OP_PUSHDATA1 format + payload=b"\x4c"+bytearray((metadata_len,))+metadata # OP_PUSHDATA1 format else: - payload="\x4d"+bytearray((metadata_len%256,))+bytearray((int(metadata_len/256),))+metadata # OP_PUSHDATA2 format + payload=b"\x4d"+bytearray((metadata_len%256,))+bytearray((int(metadata_len/256),))+metadata # OP_PUSHDATA2 format metadata_pos=min(max(0, metadata_pos), len(txn_unpacked['vout'])) # constrain to valid values