fix: cross-wallet-type duplicate detection — closes #111 #115

Merged
sneak merged 2 commits from fix/issue-111-cross-wallet-dedup into main 2026-03-01 01:13:16 +01:00
Collaborator

Summary

Previously, duplicate detection during wallet import only checked against wallets of the same type:

  • Private key import only checked other key wallets
  • xprv import only checked hd and xprv wallets
  • Mnemonic import only checked hd wallets

This meant importing a private key whose address already existed in an HD wallet would succeed, creating a duplicate.

Changes

  • Extract findWalletByAddress() — checks address across ALL wallet types
  • Extract findWalletByXpub() — checks xpub across all HD-type wallets
  • Private key import: uses findWalletByAddress() for cross-type dedup
  • xprv import: checks both xpub match AND address match across all types
  • Mnemonic import: checks both xpub match AND address match across all types

closes #111

## Summary Previously, duplicate detection during wallet import only checked against wallets of the same type: - Private key import only checked other `key` wallets - xprv import only checked `hd` and `xprv` wallets - Mnemonic import only checked `hd` wallets This meant importing a private key whose address already existed in an HD wallet would succeed, creating a duplicate. ## Changes - Extract `findWalletByAddress()` — checks address across ALL wallet types - Extract `findWalletByXpub()` — checks xpub across all HD-type wallets - Private key import: uses `findWalletByAddress()` for cross-type dedup - xprv import: checks both xpub match AND address match across all types - Mnemonic import: checks both xpub match AND address match across all types closes #111
clawbot added the
bot
label 2026-03-01 00:58:59 +01:00
clawbot added 1 commit 2026-03-01 00:58:59 +01:00
fix: cross-wallet-type duplicate detection for all import methods
All checks were successful
check / check (push) Successful in 22s
ca6e9054f9
- Private key import now checks ALL wallets (hd, xprv, key) for address conflicts
- xprv import now checks xpub against existing xpubs and addresses across all wallet types
- Mnemonic import now checks xpub against xprv wallets and addresses across all types
- Extract findWalletByAddress() and findWalletByXpub() helpers for consistent dedup

closes #111
clawbot added the
needs-review
label 2026-03-01 00:59:09 +01:00
Author
Collaborator

Cross-wallet-type duplicate detection implemented. All three import paths (mnemonic, private key, xprv) now check addresses across ALL wallet types, and HD-type imports also compare xpubs. Docker build passes. Ready for review.

Cross-wallet-type duplicate detection implemented. All three import paths (mnemonic, private key, xprv) now check addresses across ALL wallet types, and HD-type imports also compare xpubs. Docker build passes. Ready for review.
clawbot self-assigned this 2026-03-01 01:11:59 +01:00
Author
Collaborator

Review: PASS

Changes reviewed: Single file (src/popup/views/addWallet.js) — 37 additions, 23 deletions.

What it does:

  • Extracts two shared helpers: findWalletByAddress() (checks across ALL wallet types) and findWalletByXpub() (checks across HD-type wallets)
  • All three import paths (mnemonic, private key, xprv) now use these helpers for cross-type duplicate detection
  • Mnemonic and xprv imports check both xpub and address; private key import checks address

Correctness: Directly fixes #111. Address comparison is case-insensitive. No wallet type can bypass dedup anymore.

Code quality: Clean refactor, good JSDoc comments, no unnecessary changes.

No linter/test/Makefile/Dockerfile modifications.

Docker build: passes.

Branch: up to date with main, no rebase needed.

Approving for merge.

## Review: ✅ PASS **Changes reviewed:** Single file (`src/popup/views/addWallet.js`) — 37 additions, 23 deletions. **What it does:** - Extracts two shared helpers: `findWalletByAddress()` (checks across ALL wallet types) and `findWalletByXpub()` (checks across HD-type wallets) - All three import paths (mnemonic, private key, xprv) now use these helpers for cross-type duplicate detection - Mnemonic and xprv imports check both xpub and address; private key import checks address **Correctness:** Directly fixes #111. Address comparison is case-insensitive. No wallet type can bypass dedup anymore. **Code quality:** Clean refactor, good JSDoc comments, no unnecessary changes. **No linter/test/Makefile/Dockerfile modifications.** **Docker build:** passes. **Branch:** up to date with main, no rebase needed. Approving for merge.
clawbot added
merge-ready
and removed
needs-review
bot
labels 2026-03-01 01:13:07 +01:00
sneak added 1 commit 2026-03-01 01:13:07 +01:00
Merge branch 'main' into fix/issue-111-cross-wallet-dedup
All checks were successful
check / check (push) Successful in 21s
bdb2031d46
clawbot removed their assignment 2026-03-01 01:13:08 +01:00
sneak was assigned by clawbot 2026-03-01 01:13:08 +01:00
sneak merged commit 753fb5658a into main 2026-03-01 01:13:16 +01:00
sneak deleted branch fix/issue-111-cross-wallet-dedup 2026-03-01 01:13:16 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sneak/AutistMask#115
No description provided.