commit b2332af77b2edfd22ba7b951d589546f7cc40c22
parent d2261ee55bce42a6bb57c10659ef916f53b19d5f
Author: ThomasV <thomasv@electrum.org>
Date: Tue, 30 May 2017 07:01:42 +0200
Merge pull request #2465 from dabura667/history_addrs
Add input and output addresses to CLI history
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/lib/commands.py b/lib/commands.py
@@ -447,10 +447,29 @@ class Commands:
else:
date = "----"
label = self.wallet.get_label(tx_hash)
+ tx = self.wallet.transactions.get(tx_hash)
+ tx.deserialize()
+ input_addresses = []
+ output_addresses = []
+ for x in tx.inputs():
+ if x['type'] == 'coinbase': continue
+ addr = x.get('address')
+ if addr == None: continue
+ if addr == "(pubkey)":
+ prevout_hash = x.get('prevout_hash')
+ prevout_n = x.get('prevout_n')
+ _addr = self.wallet.find_pay_to_pubkey_address(prevout_hash, prevout_n)
+ if _addr:
+ addr = _addr
+ input_addresses.append(addr)
+ for addr, v in tx.get_outputs():
+ output_addresses.append(addr)
out.append({
'txid': tx_hash,
'timestamp': timestamp,
'date': date,
+ 'input_addresses': input_addresses,
+ 'output_addresses': output_addresses,
'label': label,
'value': float(value)/COIN if value is not None else None,
'height': height,