commit cb6989cea61894ab79a0ccccbc44affff9f030e4
parent 6d63140c6146c1dc2b728ba7a32ac64256bbcaad
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 25 Jun 2018 22:49:11 +0200
simplify display of inputs/outpputs in CLI history
Diffstat:
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -1068,19 +1068,8 @@ class Abstract_Wallet(PrintError):
item['label'] = self.get_label(tx_hash)
if show_addresses:
tx = self.transactions.get(tx_hash)
- tx.deserialize()
- input_addresses = []
- output_addresses = []
- for x in tx.inputs():
- if x['type'] == 'coinbase': continue
- addr = self.get_txin_address(x)
- if addr is None:
- continue
- input_addresses.append(addr)
- for addr, v in tx.get_outputs():
- output_addresses.append(addr)
- item['input_addresses'] = input_addresses
- item['output_addresses'] = output_addresses
+ item['inputs'] = list(map(lambda x: dict((k, x[k]) for k in ('prevout_hash', 'prevout_n')), tx.inputs()))
+ item['outputs'] = list(map(lambda x:{'address':x[0], 'value':Satoshis(x[1])}, tx.get_outputs()))
# value may be None if wallet is not fully synchronized
if value is None:
continue