Commit 95fdd1c
committed
Merge #932: wallet_policy: fix set_key_info silently dropping keys for repeated placeholders
1f655a9 wallet_policy: add regression test for repeated placeholder key drop (Sanket Kanjalkar)
716f0ce wallet_policy: fix set_key_info accepting extra keys for repeated placeholders (Sanket Kanjalkar)
Pull request description:
`set_key_info()` counted key-expression occurrences instead of unique placeholder indices. A template reusing `@0` with disjoint paths (e.g. `@0/**,@0/<2;3>/*`) would accept extra keys that are silently dropped during descriptor translation. Fix by counting unique placeholder indices via `BTreeSet`.
I'm not super familiar with wallet_policy/BIP-388, but this looks like a bug to me. Credit to jmeccom for reporting this.
ACKs for top commit:
apoelstra:
ACK 1f655a9; successfully ran local tests
Tree-SHA512: c1399f6c3225482d796bd32c457b096a2b69ed75129a4ea7c6250ceef2b760a8e583e52c1e0e15e0874dabeca8adf7f15c0c4ec0ea2491b1611d886b5229ffad1 file changed
Lines changed: 27 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
377 | 379 | | |
378 | 380 | | |
379 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
380 | 405 | | |
0 commit comments