CLI: Only one Request Handler can be specified. #27815
pull Brotcrunsher wants to merge 1 commits into bitcoin:master from Brotcrunsher:cli_request_handlers changing 1 files +8 −0-
Brotcrunsher commented at 0:07 am on June 4, 2023: contributorPreviously it was possible to specify multiple, however only one was picked in this arbitrary and (probably) undocumented priority: getinfo > netinfo > generate > addrinfo.
-
CLI: Only one Request Handler can be specified. Previously it was possible to specify multiple, however only one was picked in this arbitrary and (probably) undocumented priority: getinfo > netinfo > generate > addrinfo. 244e6c8db8
-
DrahtBot commented at 0:07 am on June 4, 2023: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage
For detailed information about the code coverage, see the test coverage report.
Reviews
See the guideline for information on the review process.
Type Reviewers Concept ACK pablomartin4btc If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
-
DrahtBot added the label Scripts and tools on Jun 4, 2023
-
in src/bitcoin-cli.cpp:1178 in 244e6c8db8
1169@@ -1170,6 +1170,14 @@ static int CommandLineRPC(int argc, char *argv[]) 1170 fputc('\n', stdout); 1171 } 1172 } 1173+ int nRh = 0; 1174+ if (gArgs.IsArgSet("-getinfo")) nRh++; 1175+ if (gArgs.GetBoolArg("-netinfo", false)) nRh++; 1176+ if (gArgs.GetBoolArg("-generate", false)) nRh++; 1177+ if (gArgs.GetBoolArg("-addrinfo", false)) nRh++; 1178+ if (nRh > 1) {
luke-jr commented at 1:52 am on June 24, 2023:0 if (gArgs.IsArgSet("-getinfo") + gArgs.GetBoolArg("-netinfo", false) + gArgs.GetBoolArg("-generate", false) + gArgs.GetBoolArg("-addrinfo", false) > 1) {
This is admittedly a bit obscure, so maybe there’s a better way (but it’s still an improvement over the temporary variable IMO)
luke-jr changes_requestedluke-jr commented at 0:12 am on July 3, 2023: membernit: Commit summary is too long. Would also be nice to rebase on top of 42af9596ce85a541988abee54eed8a9b271a46a1luke-jr referenced this in commit 468087b183 on Aug 16, 2023achow101 requested review from sipa on Sep 20, 2023DrahtBot added the label CI failed on Oct 25, 2023pablomartin4btc commented at 3:41 pm on October 25, 2023: memberConcept ACK.
I agree this validation should be put in place, please check #26990 if you haven’t already, in the second commit 11e0a80b19a98b79adaa25a06f14d564da3ba85b there’s a function that already does this (
IsExclusivelyCliCommand()
), feel free to take anything you find useful.As pointed out by @luke-jr please check the project guidelines regarding commits specifications.
Also, for future reference, check the guidelines regarding C++ coding style and naming conventions (e.g.
nRh
in your code change).Thanks for working on this!
maflcko commented at 3:47 pm on October 25, 2023: memberAre you still working on this?maflcko added the label Up for grabs on Nov 16, 2023maflcko closed this on Nov 16, 2023
maflcko removed the label CI failed on Nov 16, 2023fanquake removed the label Up for grabs on May 21, 2024
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC
More mirrored repositories can be found on mirror.b10c.me