diff --git a/src/rpc/util.h b/src/rpc/util.h --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -116,8 +116,7 @@ class RPCHelpMan { public: RPCHelpMan(const std::string &name, const std::string &description, - const std::vector &args) - : m_name{name}, m_description{description}, m_args{args} {} + const std::vector &args); std::string ToString() const; diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -283,6 +283,16 @@ } }; +RPCHelpMan::RPCHelpMan(const std::string &name, const std::string &description, + const std::vector &args) + : m_name{name}, m_description{description}, m_args{args} { + std::set named_args; + for (const auto &arg : m_args) { + // Should have unique named arguments + CHECK_NONFATAL(named_args.insert(arg.m_name).second); + } +} + std::string RPCHelpMan::ToString() const { std::string ret;