Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/model/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ export const createWallet = async ({

// Initiate auto account discovery for imported wallets via seedphrase
// or for hardware wallets
if ((isHDWallet && root && isImported) || (isHardwareWallet && seed)) {
if (!isRestoring && ((isHDWallet && root && isImported) || (isHardwareWallet && seed))) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve derived accounts during backup restore

This !isRestoring gate removes the only account-expansion path during cloud restore, because restoreSpecificBackupIntoKeychain always calls createWallet(..., isRestoring: true) and createWallet otherwise only adds index 0; in the current restore parser, non-cipher entries only populate seed phrases (src/model/backup.ts:517-519), so iCloud restores can no longer recover additional derived accounts that previously came from this discovery loop. Repro: on iOS, create a mnemonic wallet with funds/activity on account index 1+, make an iCloud cloud backup, reinstall/restore, and compare wallet accounts before vs after this commit—the post-fix restore can end with only the first account (or changed wallet grouping), which is a behavioral regression specific to backup paths.

Useful? React with 👍 / 👎.

logger.debug('[wallet]: initializing account auto discovery', {}, DebugContext.wallet);
let index = 1;
let lookup = 0;
Expand Down
Loading