add listunspent

This commit is contained in:
thomasv 2013-02-22 14:26:18 +01:00
parent b1f33015af
commit a1a5886e57
1 changed files with 9 additions and 1 deletions

View File

@ -91,11 +91,13 @@ options:\n --fee, -f: set transaction fee\n --fromaddr, -s: send from address
'unfreeze':'',
'prioritize':'',
'unprioritize':'',
'dumpprivkey':'',
'dumpprivkey':'similar to bitcoind\'s command',
'listunspent':'similar to bitcoind\'s command',
'createmultisig':'similar to bitcoind\'s command',
'createrawtransaction':'similar to bitcoind\'s command',
'decoderawtransaction':'similar to bitcoind\'s command',
'signrawtransaction':'similar to bitcoind\'s command',
}
@ -109,6 +111,7 @@ offline_commands = [ 'password', 'mktx', 'signtx',
'deseed','reseed',
'freeze','unfreeze',
'prioritize','unprioritize',
'dumpprivkey','listunspent',
'createmultisig', 'createrawtransaction', 'decoderawtransaction', 'signrawtransaction'
]
@ -774,6 +777,11 @@ if __name__ == '__main__':
tx.sign( private_keys )
print_msg(tx)
elif cmd == 'listunspent':
unspent = map(lambda x: {"txid":x[0].split(':')[0],"vout":x[0].split(':')[1],"amount":x[1]*1.e-8}, wallet.prevout_values.items() )
print_json(unspent)
if cmd not in offline_commands and not options.offline: