commit 12e2b8db16eebd4f647361913c20edfe8dcc3bcb
parent 36daa3209191791715bfb72e5f3ddc8b3bf151e5
Author: ThomasV <thomasv@gitorious>
Date: Sat, 19 May 2012 11:01:45 +0200
show address if coins were received at a change address
Diffstat:
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/lib/wallet.py b/lib/wallet.py
@@ -766,11 +766,21 @@ class Wallet:
else:
for o_addr in tx['outputs']:
if self.is_mine(o_addr) and not self.is_change(o_addr):
- dest_label = self.labels.get(o_addr)
- if dest_label:
- default_label = 'at: ' + dest_label
- else:
- default_label = 'at: ' + o_addr
+ break
+ else:
+ for o_addr in tx['outputs']:
+ if self.is_mine(o_addr):
+ break
+ else:
+ o_addr = None
+
+ if o_addr:
+ dest_label = self.labels.get(o_addr)
+ if dest_label:
+ default_label = 'at: ' + dest_label
+ else:
+ default_label = 'at: ' + o_addr
+
tx['default_label'] = default_label
def mktx(self, to_address, amount, label, password, fee=None, change_addr=None, from_addr= None):