Commit 7500644
committed
Fix BTC segwit regex to accept testnet (tb) prefix
The bech32/segwit branch guard routes both `bc` (mainnet) and `tb` (testnet)
HRPs into the regex, but the regex accepted `(bc|tc)`. `tc` is not a valid
Bitcoin HRP (mainnet is `bc`, testnet is `tb`), and since the guard never
lets a `tc`-prefixed value reach the regex, that alternative was dead code.
As a result every valid testnet segwit address was rejected.
Change the regex alternative to `(bc|tb)` and add a testnet address test.1 parent 70de324 commit 7500644
2 files changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
0 commit comments