Skip to content

Commit

Permalink
Run history_list_filter hook on updated labels
Browse files Browse the repository at this point in the history
This way an edited label can be filtered directly instead of during
update of the entire history_list.

This can be seen if someone has CashFusion running and the "Hide
CashFusions" option enabled and proceeds to rename a label to start with
"CashFusion ".
Without this fix the transaction is not hidden until the
wallet is restarted or the "Hide CashFusions" option is toggled off and
on.
  • Loading branch information
jonas-lundqvist committed Sep 8, 2020
1 parent 4e40359 commit a07f0ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gui/qt/history_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,18 @@ def update_labels(self):
return
root = self.invisibleRootItem()
child_count = root.childCount()
filtered_list = []
for i in range(child_count):
item = root.child(i)
txid = item.data(0, Qt.UserRole)
label = self.wallet.get_label(txid)
item.setText(3, label)
filtered = run_hook("history_list_filter", self, item, label, multi=True) or []
if any(filtered):
filtered_list.append(item)

for item in filtered_list:
root.removeChild(item)

def update_item(self, tx_hash, height, conf, timestamp):
if not self.wallet: return # can happen on startup if this is called before self.on_update()
Expand Down

0 comments on commit a07f0ab

Please sign in to comment.