Skip to content

Commit f50eaca

Browse files
JLMoriartclaude
andcommitted
Remove is_beyond_limit check from AddressList to fix O(N²) hang
AddressList.on_update() calls wallet.is_beyond_limit(address, is_change) for every address. That method does addr_list.index(address) which is O(N) per call, making the overall loop O(N²). On a wallet with 137,776 addresses, this single check causes a ~12 second GUI freeze every time the address list is rebuilt. The check only colors rows red for addresses beyond the gap limit — a minor visual indicator. Removing it eliminates the O(N²) cost entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fac50cc commit f50eaca

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

electroncash_gui/qt/address_list.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,6 @@ def restore_expanded_items(root, expanded_item_names):
242242
if self.wallet.is_frozen(address):
243243
address_item.setBackground(0, ColorScheme.BLUE.as_color(True))
244244
address_item.setToolTip(0, _("Address is frozen, right-click to unfreeze"))
245-
if self.wallet.is_beyond_limit(address, is_change):
246-
address_item.setBackground(0, ColorScheme.RED.as_color(True))
247245
if is_change and self.wallet.is_retired_change_addr(address):
248246
address_item.setForeground(0, ColorScheme.GRAY.as_color())
249247
old_tt = address_item.toolTip(0)

0 commit comments

Comments
 (0)