tFix receiving filtering in lite gui to account for both results of transactions.get - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 2e8281d21cd5ac476b35b03ffcbc41dbe58051b7
DIR parent 2216b6e127407bea8b09395708df62788e99552d
HTML Author: Maran <maran.hidskes@gmail.com>
Date: Sat, 15 Dec 2012 15:45:36 +0100
Fix receiving filtering in lite gui to account for both results of transactions.get
Diffstat:
M lib/receiving_widget.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
---
DIR diff --git a/lib/receiving_widget.py b/lib/receiving_widget.py
t@@ -35,17 +35,24 @@ class ReceivingWidget(QTreeWidget):
def update_list(self):
-
self.clear()
addresses = [addr for addr in self.owner.actuator.wallet.all_addresses() if not self.owner.actuator.wallet.is_change(addr)]
for address in addresses:
history = self.owner.actuator.wallet.history.get(address,[])
used = "No"
- for tx_hash in history:
- tx = self.owner.actuator.wallet.transactions.get(tx_hash)
- if tx:
- used = "Yes"
+ # It appears that at this moment history can either be an array with tx and block height
+ # Or just a tx that's why this ugly code duplication is in, will fix
+ if len(history) == 1:
+ for tx_hash in history:
+ tx = self.owner.actuator.wallet.transactions.get(tx_hash)
+ if tx:
+ used = "Yes"
+ else:
+ for tx_hash, height in history:
+ tx = self.owner.actuator.wallet.transactions.get(tx_hash)
+ if tx:
+ used = "Yes"
if(self.hide_used == True and used == "No") or self.hide_used == False:
label = self.owner.actuator.wallet.labels.get(address,'')