aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-15 19:45:01 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-08-02 21:32:30 +0200
commitfa459bdc87bbb050ca1c8d469023a96ed798540e (patch)
tree8da3e363a68e96727de37b4f6c8412b9514a8cdf /src/rpc/util.cpp
parenta78742830aa35bf57bcb0a4730977a1e5a1876bc (diff)
downloadbitcoin-fa459bdc87bbb050ca1c8d469023a96ed798540e.tar.xz
rpc: Treat all args after a hidden arg as hidden as well
This commit has no effect right now, but hardens the code for the future
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 9f4c7bee9c..e3db1dd513 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -504,7 +504,7 @@ std::string RPCHelpMan::ToString() const
ret += m_name;
bool was_optional{false};
for (const auto& arg : m_args) {
- if (arg.m_hidden) continue;
+ if (arg.m_hidden) break; // Any arg that follows is also hidden
const bool optional = arg.IsOptional();
ret += " ";
if (optional) {
@@ -526,7 +526,7 @@ std::string RPCHelpMan::ToString() const
Sections sections;
for (size_t i{0}; i < m_args.size(); ++i) {
const auto& arg = m_args.at(i);
- if (arg.m_hidden) continue;
+ if (arg.m_hidden) break; // Any arg that follows is also hidden
if (i == 0) ret += "\nArguments:\n";