Browse Source

fix address balance (received coins)

283
ThomasV 12 years ago
parent
commit
df1d7152fd
  1. 9
      lib/wallet.py

9
lib/wallet.py

@ -485,15 +485,16 @@ class Wallet:
h = self.history.get(address,[]) h = self.history.get(address,[])
if h == ['*']: return 0,0 if h == ['*']: return 0,0
c = u = 0 c = u = 0
received_coins = [] received_coins = [] # list of coins received at address
for tx_hash, tx_height in h: for tx_hash, tx_height in h:
d = self.transactions.get(tx_hash) d = self.transactions.get(tx_hash)
if not d: continue if not d: continue
for item in d.get('outputs'): for item in d.get('outputs'):
addr = item.get('address') addr = item.get('address')
key = tx_hash + ':%d'%item['index'] if addr == address:
received_coins.append(key) key = tx_hash + ':%d'%item['index']
received_coins.append(key)
for tx_hash, tx_height in h: for tx_hash, tx_height in h:
d = self.transactions.get(tx_hash) d = self.transactions.get(tx_hash)

Loading…
Cancel
Save