From df1d7152fd7d5476a32cd4e5541d021e3e0b2900 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Fri, 28 Dec 2012 17:57:33 +0100 Subject: [PATCH] fix address balance (received coins) --- lib/wallet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/wallet.py b/lib/wallet.py index 0953b033a..31b502699 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -485,15 +485,16 @@ class Wallet: h = self.history.get(address,[]) if h == ['*']: return 0,0 c = u = 0 - received_coins = [] - + received_coins = [] # list of coins received at address + for tx_hash, tx_height in h: d = self.transactions.get(tx_hash) if not d: continue for item in d.get('outputs'): addr = item.get('address') - key = tx_hash + ':%d'%item['index'] - received_coins.append(key) + if addr == address: + key = tx_hash + ':%d'%item['index'] + received_coins.append(key) for tx_hash, tx_height in h: d = self.transactions.get(tx_hash)