fix createrawtransaction (issue #574)
This commit is contained in:
parent
2070672ac7
commit
9d5f39c235
|
@ -160,14 +160,12 @@ class Commands:
|
||||||
|
|
||||||
|
|
||||||
def createrawtransaction(self, inputs, outputs):
|
def createrawtransaction(self, inputs, outputs):
|
||||||
# convert to own format
|
inputs = map(lambda i: {'prevout_hash': i['txid'], 'prevout_n':i['vout']}, inputs )
|
||||||
for i in inputs:
|
|
||||||
i['tx_hash'] = i['txid']
|
|
||||||
i['index'] = i['vout']
|
|
||||||
outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items())
|
outputs = map(lambda x: (x[0],int(1e8*x[1])), outputs.items())
|
||||||
tx = Transaction.from_io(inputs, outputs)
|
tx = Transaction.from_io(inputs, outputs)
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
|
|
||||||
def signrawtransaction(self, raw_tx, input_info, private_keys):
|
def signrawtransaction(self, raw_tx, input_info, private_keys):
|
||||||
tx = Transaction(raw_tx)
|
tx = Transaction(raw_tx)
|
||||||
self.wallet.signrawtransaction(tx, input_info, private_keys, self.password)
|
self.wallet.signrawtransaction(tx, input_info, private_keys, self.password)
|
||||||
|
|
|
@ -671,7 +671,7 @@ class Transaction:
|
||||||
item = {
|
item = {
|
||||||
'prevout_hash':i['prevout_hash'],
|
'prevout_hash':i['prevout_hash'],
|
||||||
'prevout_n':i['prevout_n'],
|
'prevout_n':i['prevout_n'],
|
||||||
'address':i['address'],
|
'address':i.get('address'),
|
||||||
'KeyID':i.get('KeyID'),
|
'KeyID':i.get('KeyID'),
|
||||||
'scriptPubKey':i.get('scriptPubKey'),
|
'scriptPubKey':i.get('scriptPubKey'),
|
||||||
'redeemScript':i.get('redeemScript'),
|
'redeemScript':i.get('redeemScript'),
|
||||||
|
|
Loading…
Reference in New Issue