|
|
|
|
@ -639,7 +639,7 @@ if __name__ == '__main__':
|
|
|
|
|
out = {"hex":str(tx), "complete":tx.is_complete} |
|
|
|
|
if not tx.is_complete: |
|
|
|
|
import json |
|
|
|
|
out['input_info'] = repr(tx.inputs_info).replace(' ','') |
|
|
|
|
out['input_info'] = repr(tx.input_info).replace(' ','') |
|
|
|
|
print_json(out) |
|
|
|
|
|
|
|
|
|
if is_temporary: |
|
|
|
|
@ -736,8 +736,8 @@ if __name__ == '__main__':
|
|
|
|
|
|
|
|
|
|
elif cmd == 'signrawtransaction': |
|
|
|
|
tx = Transaction(args[1]) |
|
|
|
|
inputs_info = ast.literal_eval(args[2]) if len(args)>2 else [] |
|
|
|
|
private_keys = ast.literal_eval(args[3]) if len(args)>3 else {} |
|
|
|
|
input_info = ast.literal_eval(args[2]) if len(args)>2 else [] |
|
|
|
|
private_keys = ast.literal_eval(args[3]) if len(args)>3 else [] |
|
|
|
|
unspent_coins = wallet.get_unspent_coins() |
|
|
|
|
|
|
|
|
|
# convert private_keys to dict |
|
|
|
|
@ -752,7 +752,7 @@ if __name__ == '__main__':
|
|
|
|
|
txin['tx_hash'] = txin['prevout_hash'] |
|
|
|
|
txin['index'] = txin['prevout_n'] |
|
|
|
|
|
|
|
|
|
for item in inputs_info: |
|
|
|
|
for item in input_info: |
|
|
|
|
if item.get('txid') == txin['tx_hash'] and item.get('vout') == txin['index']: |
|
|
|
|
txin['raw_output_script'] = item['scriptPubKey'] |
|
|
|
|
txin['redeemScript'] = item.get('redeemScript') |
|
|
|
|
@ -777,7 +777,7 @@ if __name__ == '__main__':
|
|
|
|
|
private_keys[address] = sec |
|
|
|
|
|
|
|
|
|
elif txin.get("redeemScript"): |
|
|
|
|
txin['address'] = hash_160_to_bc_address(hash_160(txin.get("redeemScript").decode('hex')), 5) |
|
|
|
|
txin['address'] = bitcoin.hash_160_to_bc_address(bitcoin.hash_160(txin.get("redeemScript").decode('hex')), 5) |
|
|
|
|
|
|
|
|
|
elif txin.get("raw_output_script"): |
|
|
|
|
addr = deserialize.get_address_from_output_script(txin.get("raw_output_script").decode('hex')) |
|
|
|
|
|