What changed, and why it matters
This commit simply enables the `--wallet` command-line option to work on Bitcoin's regression test network (regtest) by assigning it the default port 18332. Previously, using `--wallet` with `--regtest` produced an error because the companion btcwallet software did not yet support regtest. There is no security issue here; it is a routine feature-enablement change.
No security action required. Treat as a normal feature update.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In cmd/btcctl/config.go, the normalizeAddress function previously returned an error when useWallet was true on RegressionNetParams. The patch removes that error and sets defaultPort = "18332", matching btcwallet’s new regtest listener port. This is a configuration/default change with no cryptographic, network, or access-control implications.
Changed components
cmd/btcctl/config.gobtcctl --wallet option on regtestInspect captured patch +1 / −3
diff --git a/cmd/btcctl/config.go b/cmd/btcctl/config.go
index 023dd93..db38bc3 100644
--- a/cmd/btcctl/config.go
+++ b/cmd/btcctl/config.go
@@ -140,9 +140,7 @@ func normalizeAddress(addr string, chain *chaincfg.Params, useWallet bool) (stri
}
case &chaincfg.RegressionNetParams:
if useWallet {
- // TODO: add port once regtest is supported in btcwallet
- paramErr := fmt.Errorf("cannot use -wallet with -regtest, btcwallet not yet compatible with regtest")
- return "", paramErr
+ defaultPort = "18332"
} else {
defaultPort = "18334"
}
Why this scored 20/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.