Author

Topic: JSON error while creating raw transaction with Python (Read 603 times)

newbie
Activity: 38
Merit: 0
Duh... Thank you very much.

For reference, here is code that worked:
Code:
client.createrawtransaction([{'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 0}, {'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 1}], {'mtBA36egrarxkCuzu64e7EtuwUUphS8GWn':17.9998})
legendary
Activity: 3472
Merit: 4801
I've been trying to create a raw transaction over JSON-RPC using Python and can't figure out why I receive this error:

Code:
>>> client.createrawtransaction([{'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 17.9995}], {'mtBA36egrarxkCuzu64e7EtuwUUphS8GWn': 17.999})

Traceback (most recent call last):
  File "", line 1, in
    client.createrawtransaction([{'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 17.9995}], {'mtBA36egrarxkCuzu64e7EtuwUUphS8GWn': 17.999})
  File "C:\Python27\lib\site-packages\jsonrpc\proxy.py", line 45, in __call__
    raise JSONRPCException(resp['error'])
JSONRPCException

vout is an integer index into the transaction referenced by txid.  It can't be 17.9995.

if you run:

Code:
listunspent

you should get a list of unspent outputs that your wallet has the ability to spend.

Each unspent output will have a "txid" value and a "vout" value.  These are the two pieces of information that you have to supply to createrawtransaction if you want to spend that output.
newbie
Activity: 38
Merit: 0
I've been trying to create a raw transaction over JSON-RPC using Python and can't figure out why I receive this error:

Code:
>>> client.createrawtransaction([{'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 17.9995}], {'mtBA36egrarxkCuzu64e7EtuwUUphS8GWn': 17.999})

Traceback (most recent call last):
  File "", line 1, in
    client.createrawtransaction([{'txid': 'e1e5775f467a2803a4ebc6e17f223617062d9a98a953d5eaef06ab9ae0b2a400', 'vout': 17.9995}], {'mtBA36egrarxkCuzu64e7EtuwUUphS8GWn': 17.999})
  File "C:\Python27\lib\site-packages\jsonrpc\proxy.py", line 45, in __call__
    raise JSONRPCException(resp['error'])
JSONRPCException
Jump to: