improve 'addresses' console command
This commit is contained in:
parent
50b7bc3474
commit
e463968da3
25
electrum
25
electrum
|
@ -382,22 +382,25 @@ if __name__ == '__main__':
|
||||||
elif cmd in [ 'addresses']:
|
elif cmd in [ 'addresses']:
|
||||||
for addr in wallet.all_addresses():
|
for addr in wallet.all_addresses():
|
||||||
if options.show_all or not wallet.is_change(addr):
|
if options.show_all or not wallet.is_change(addr):
|
||||||
label = wallet.labels.get(addr)
|
|
||||||
_type = ''
|
flags = "C" if wallet.is_change(addr) else "I" if addr in wallet.imported_keys.keys() else "-"
|
||||||
if wallet.is_change(addr): _type = "[change]"
|
flags += "F" if addr in wallet.frozen_addresses else "P" if addr in wallet.prioritized_addresses else "-"
|
||||||
if addr in wallet.imported_keys.keys(): _type = "[imported]"
|
|
||||||
if label is None: label = ''
|
label = wallet.labels.get(addr,'')
|
||||||
|
if label: label = "\"%s\""%label
|
||||||
|
|
||||||
if options.show_balance:
|
if options.show_balance:
|
||||||
h = wallet.history.get(addr,[])
|
h = wallet.history.get(addr,[])
|
||||||
ni = no = 0
|
#ni = no = 0
|
||||||
for item in h:
|
#for item in h:
|
||||||
if item['is_input']: ni += 1
|
# if item['is_input']: ni += 1
|
||||||
else: no += 1
|
# else: no += 1
|
||||||
b = "%d %d %s"%(no, ni, str(Decimal(wallet.get_addr_balance(addr)[0])/100000000))
|
b = format_satoshis(wallet.get_addr_balance(addr)[0])
|
||||||
else: b=''
|
else: b=''
|
||||||
|
addr = "%34s"%addr
|
||||||
if options.show_keys:
|
if options.show_keys:
|
||||||
addr += ':' + str(wallet.get_private_key_base58(addr, password))
|
addr += ':' + str(wallet.get_private_key_base58(addr, password))
|
||||||
print addr, b, _type, label
|
print flags, addr, b, label
|
||||||
|
|
||||||
if cmd == 'history':
|
if cmd == 'history':
|
||||||
lines = wallet.get_tx_history()
|
lines = wallet.get_tx_history()
|
||||||
|
|
Loading…
Reference in New Issue