subaddress: append addresses discovered during synchronization by eightjean · Pull Request #318 · feather-wallet/feather · GitHub
Skip to content

subaddress: append addresses discovered during synchronization - #318

Open
eightjean wants to merge 1 commit into
feather-wallet:masterfrom
eightjean:fix/issue-243-subaddress-desync
Open

eightjean wants to merge 1 commit into
feather-wallet:masterfrom
eightjean:fix/issue-243-subaddress-desync

Conversation

@eightjean

Copy link
Copy Markdown

After restoring a wallet that had received to a subaddress #11 or higher, the Receive tab stops at #10, and creating a new address can crash Feather after QSortFilterProxyModel: invalid inserted rows reported by source model (#243).

Cause:

  • Opening a restored wallet fills the list to Add github link on website homepage #10 (MainWindow::onWalletOpened). While scanning, wallet2 adds every subaddress it receives to (an output to Ledger Nano S Plus device is not recognized #13 makes 14 addresses), but since c5aef15 the synchronized callbacks only call Subaddress::updateUsed, which walks the rows already in the list.
  • Since ce2f332, Subaddress::addRow takes the new row's index from wallet2, so it announces row 14 to a model with 11 rows. emplaceRow refuses that row, the result is ignored, and the proxy is told about a row that does not exist. The same happens without a click when every listed address is used, through noUnusedSubaddresses.
  • The workarounds in the issue (hide/unhide, sending, switching accounts) work because they call refresh().

The change adds Subaddress::appendRows(), which appends the addresses wallet2 knows and the list does not, through emplaceRow and its existing checks, with the insert signals only around a row it accepted. updateUsed calls it before looking for an unused address, and addRow calls it after creating one. If a row fails the checks, it falls back to refresh() and its corruption handling. Ordinary blocks still do not reset the model. beginInsertRows now gets the root index explicitly.

Fixes #243

Testing: built in a Linux container with the CI's Ubuntu 24.04 steps (cmake -DWITH_SCANNER=OFF .. && cmake --build . -j $(nproc)). Reproduced on a local regtest node (monerod --regtest --offline, v0.18.5.4): a wallet received to #1–#10 and #13, was restored from its seed into a new file and opened in Feather under Xvfb. Without the change, after synchronization the Receive tab showed only #0–#10 and Feather logged the warning above; after Create new address it crashed (SIGSEGV) as soon as the table was clicked. With the change, #11–#13 appear after synchronization with the original wallet's addresses, Create new address adds #14, the model warning does not appear, and Feather quits normally.

Prepared with AI assistance.

🤖 Generated with Claude Code

Keep the Receive list in sync with addresses found during scanning.
This fixes missing addresses and crashes when creating a new address
after restoring a wallet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate new address crash

1 participant