From 6cb51ea4d03f0586cdeb6dcc6532038ba8d24c2e Mon Sep 17 00:00:00 2001 From: thomasv Date: Thu, 22 Nov 2012 13:24:44 +0100 Subject: [PATCH] received coins need to be known before --- lib/wallet.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/wallet.py b/lib/wallet.py index 756bd4b3..d24ffdeb 100644 --- a/lib/wallet.py +++ b/lib/wallet.py @@ -484,6 +484,14 @@ class Wallet: c = u = 0 received_coins = [] + 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) + for tx_hash, tx_height in h: d = self.transactions.get(tx_hash) if not d: continue @@ -502,7 +510,6 @@ class Wallet: key = tx_hash + ':%d'%item['index'] if addr == address: v += item.get('value') - received_coins.append(key) if tx_height: c += v