From 76b838b2d5c2c59173f521f260391a7ade55d6e9 Mon Sep 17 00:00:00 2001 From: WizardOfOzzie Date: Thu, 26 Nov 2015 03:57:28 +1100 Subject: [PATCH] blockcypher_mktx Tweaked JSON dumps --- bitcoin/bci.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bitcoin/bci.py b/bitcoin/bci.py index 31f09bc0..e97f71e1 100644 --- a/bitcoin/bci.py +++ b/bitcoin/bci.py @@ -499,6 +499,7 @@ def get_block_height(txhash): j = json.loads(make_request('https://blockchain.info/rawtx/'+txhash).decode("utf-8")) return j['block_height'] + # fromAddr, toAddr, 12345, changeAddress def get_tx_composite(inputs, outputs, output_value, change_address=None, network=None): """mktx using blockcypher API""" @@ -520,7 +521,7 @@ def get_tx_composite(inputs, outputs, output_value, change_address=None, network } if change_address: data["change_address"] = change_address # - jdata = json.loads(make_request(url, data)) + jdata = json.loads(make_request(url, json.dumps(data))) hash, txh = jdata.get("tosign")[0], jdata.get("tosign_tx")[0] assert bin_dbl_sha256(txh.decode('hex')).encode('hex') == hash, "checksum mismatch %s" % hash return txh.encode("utf-8")