Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion bitcoin/bci.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand All @@ -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")
Expand Down