remove signtx command (replaced by signrawtransaction).
This commit is contained in:
parent
64ad3fc28c
commit
c4f7ce6bae
26
electrum
26
electrum
|
@ -68,7 +68,6 @@ options:
|
||||||
Syntax: mktx <recipient> <amount> [label]
|
Syntax: mktx <recipient> <amount> [label]
|
||||||
options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
|
options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address -\n --changeaddr, -c: send change to address
|
||||||
""",
|
""",
|
||||||
'signtx':"Sign an unsigned transaction created by a deseeded wallet\nSyntax: signtx <filename>",
|
|
||||||
'seed':
|
'seed':
|
||||||
"Print the generation seed of your wallet.",
|
"Print the generation seed of your wallet.",
|
||||||
'importprivkey':
|
'importprivkey':
|
||||||
|
@ -102,7 +101,7 @@ options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
offline_commands = [ 'password', 'mktx', 'signtx',
|
offline_commands = [ 'password', 'mktx',
|
||||||
'label', 'contacts',
|
'label', 'contacts',
|
||||||
'help', 'validateaddress',
|
'help', 'validateaddress',
|
||||||
'signmessage', 'verifymessage',
|
'signmessage', 'verifymessage',
|
||||||
|
@ -116,7 +115,7 @@ offline_commands = [ 'password', 'mktx', 'signtx',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
protected_commands = ['payto', 'password', 'mktx', 'signtx', 'seed', 'importprivkey','signmessage', 'signrawtransaction','dumpprivkey' ]
|
protected_commands = ['payto', 'password', 'mktx', 'seed', 'importprivkey','signmessage', 'signrawtransaction','dumpprivkey' ]
|
||||||
|
|
||||||
# get password routine
|
# get password routine
|
||||||
def prompt_password(prompt, confirm=True):
|
def prompt_password(prompt, confirm=True):
|
||||||
|
@ -644,11 +643,6 @@ if __name__ == '__main__':
|
||||||
del(wallet.history[from_addr])
|
del(wallet.history[from_addr])
|
||||||
wallet.save()
|
wallet.save()
|
||||||
|
|
||||||
elif cmd == 'signtx':
|
|
||||||
tx = Transaction(args[1])
|
|
||||||
tx = wallet.sign_tx( tx, password )
|
|
||||||
print_msg(tx)
|
|
||||||
|
|
||||||
elif cmd == 'sendtx':
|
elif cmd == 'sendtx':
|
||||||
tx = args[1]
|
tx = args[1]
|
||||||
r, h = wallet.sendtx( tx )
|
r, h = wallet.sendtx( tx )
|
||||||
|
@ -740,27 +734,25 @@ if __name__ == '__main__':
|
||||||
tx = Transaction(args[1])
|
tx = Transaction(args[1])
|
||||||
txouts = ast.literal_eval(args[2]) if len(args)>2 else []
|
txouts = ast.literal_eval(args[2]) if len(args)>2 else []
|
||||||
private_keys = ast.literal_eval(args[3]) if len(args)>3 else {}
|
private_keys = ast.literal_eval(args[3]) if len(args)>3 else {}
|
||||||
|
unspent_coins = wallet.get_unspent_coins()
|
||||||
|
|
||||||
for txin in tx.inputs:
|
for txin in tx.inputs:
|
||||||
txid = txin["prevout_hash"]
|
|
||||||
index = txin["prevout_n"]
|
|
||||||
# convert to own format
|
# convert to own format
|
||||||
txin['tx_hash'] = txin['prevout_hash']
|
txin['tx_hash'] = txin['prevout_hash']
|
||||||
txin['index'] = txin['prevout_n']
|
txin['index'] = txin['prevout_n']
|
||||||
|
|
||||||
for txout in txouts:
|
for txout in txouts:
|
||||||
if txout.get('txid') == txid and txout.get('vout') == index:
|
if txout.get('txid') == txin['tx_hash'] and txout.get('vout') == txin['index']:
|
||||||
txin['raw_output_script'] = txout['scriptPubKey']
|
txin['raw_output_script'] = txout['scriptPubKey']
|
||||||
txin['redeemScript'] = txout['redeemScript']
|
txin['redeemScript'] = txout['redeemScript']
|
||||||
break
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if wallet.transactions.get(txid):
|
for item in unspent_coins:
|
||||||
# lookup in my own list of transactions
|
if txin['tx_hash'] == item['tx_hash'] and txin['index'] == item['index']:
|
||||||
txout = wallet.transactions[txid].outputs[index]
|
txin['address'] = item['address']
|
||||||
txin['address'] = txout[0]
|
txin['raw_output_script'] = item['raw_output_script']
|
||||||
#txin['raw_output_script'] = txout['raw_output_script']
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# if neither, we might want to get it from the server..
|
# if neither, we might want to get it from the server..
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in New Issue