Repository navigation
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsNo conflicts as of last run. |
|
Optional test suggestion: set This would cover the |
3f178e0 to
cb7bb77
Compare
Thanks! I replaced the CLI test which passes the same invalid value twice ( |
cb7bb77 to
54fe0ec
Compare
|
Dropped the rename.1 23a88a4 now introduces Footnotes
|
We parse and validate -signetchallenge in two places: GetSignetDataDir() and ReadSigNetArgs(). To have consistent behavior between bitcoind and bitcoin-cli, we extract the code for -signetchallenge in ReadSigNetArgs() into a helper function ReadSignetChallengeArg() which can be reused in GetSignetDataDir() in the next commit.
bitcoind returns an useful error when invalid hex is passed to -signetchallenge: ``` $ bitcoind -signet -signetchallenge=z Error: -signetchallenge must be hex, not 'z' ``` The error returned by bitcoin-cli only indicates that the RPC cookie wasn't found. It doesn't hint at invalid hex: ``` $ bitcoin-cli -signet -signetchallenge=z getblockcount error: Authorization failed: ... Is your -signetchallenge correct for custom signets? ``` To have consistent validation of signet args in bitcoind and bitcoin-cli, we now parse -signetchallenge with ReadSignetChallengeArg() in GetSignetDataDir() and add tests.
54fe0ec to
28c2561
Compare

bitcoindreturns an useful error when invalid hex is passed to-signetchallenge:The error returned by
bitcoin-clionly indicates that the RPC cookie wasn't found. It doesn't hint at invalid hex:To have consistent validation of signet args in
bitcoindandbitcoin-cli, we now parse-signetchallengein a newReadSignetChallengeArg()function which is called inGetSignetDataDir()andReadSigNetArgs().Addresses #34566 (comment)
I didn't add a release note because I don't think this change of an error message warrants one.