From 64a08f4937b916a8ca3cba2e57ffa0bae5057b80 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Tue, 9 Sep 2025 12:55:12 +0200 Subject: [PATCH] fix #10206: replace for loop with single operation (dicts are threadsafe) --- electrum/gui/qt/utxo_list.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/electrum/gui/qt/utxo_list.py b/electrum/gui/qt/utxo_list.py index 6be01fb35..ea98e13ff 100644 --- a/electrum/gui/qt/utxo_list.py +++ b/electrum/gui/qt/utxo_list.py @@ -103,12 +103,11 @@ class UTXOList(MyTreeView): self.proxy.setDynamicSortFilter(False) # temp. disable re-sorting after every change utxos = self.wallet.get_utxos() self._maybe_reset_coincontrol(utxos) - self._utxo_dict = {} + self._utxo_dict = dict([(utxo.prevout.to_str(), utxo) for utxo in utxos]) self.std_model.clear() self.update_headers(self.__class__.headers) for idx, utxo in enumerate(utxos): name = utxo.prevout.to_str() - self._utxo_dict[name] = utxo labels = [""] * len(self.Columns) amount_str = self.main_window.format_amount( utxo.value_sats(), whitespaces=True)