Commit c40f3db
committed
Merge #7076: fix: only activate BIP44 descriptors for external signers, fix mocked signers
0a72191 test: drop incorrect descriptors (UdjinM6)
6b837a5 test: fix expected descriptor path (UdjinM6)
fc73a5a fix: only activate BIP44 descriptors for external signers (UdjinM6)
Pull request description:
## Issue being fixed or feature implemented
When creating a wallet with an external signer (hardware wallet), the mock signer returns multiple descriptors (BIP44, BIP49, BIP84) for both receive and internal categories. Previously, all valid descriptors were being activated by calling AddActiveScriptPubKeyMan() for each one.
This caused a database key collision since multiple descriptors tried to write to the same key (ACTIVEEXTERNALSPK or ACTIVEINTERNALSPK), resulting in non-deterministic behavior where sometimes BIP44 would be active and sometimes BIP84, depending on database flush timing.
## What was done?
The fix follows the pattern from the non-external-signer branch which stores multiple descriptors but only activates certain types (External and Internal, but not CoinJoin). Now we:
- Store ALL descriptors returned by the signer in m_spk_managers
- Only activate descriptors matching the BIP44 path pattern /44'/{cointype}'
This ensures deterministic behavior and fixes the intermittent test failure in wallet_signer.py where the test expected m/44' but sometimes got m/84'.
Should fix intermittent test failures like https://github.com/dashpay/dash/actions/runs/20364286460/job/58521843159#step:6:1662
## How Has This Been Tested?
Run `wallet_signer.py` multiple times
## Breaking Changes
n/a
## Checklist:
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e tests
- [ ] I have made corresponding changes to the documentation
- [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
ACKs for top commit:
PastaPastaPasta:
utACK 0a72191
knst:
ACK 0a72191
Tree-SHA512: a570976023d1319542dd4a236feb4c39e4fc716fcd9c56fc3368180fe8fb95e9af07623fff1bef04c90a478dde34deea860dba4a63f74606dba54d86b0342b3dFile tree
3 files changed
+11
-16
lines changed- src/wallet
- test/functional/mocks
3 files changed
+11
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3967 | 3967 | | |
3968 | 3968 | | |
3969 | 3969 | | |
3970 | | - | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
3971 | 3976 | | |
3972 | 3977 | | |
3973 | 3978 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
33 | 29 | | |
34 | 30 | | |
35 | | - | |
36 | | - | |
37 | | - | |
| 31 | + | |
38 | 32 | | |
39 | 33 | | |
40 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
34 | | - | |
35 | | - | |
| 31 | + | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
| |||
44 | 40 | | |
45 | 41 | | |
46 | 42 | | |
47 | | - | |
| 43 | + | |
48 | 44 | | |
49 | 45 | | |
50 | 46 | | |
| |||
0 commit comments