Skip to content

Commit 0c7ac92

Browse files
committed
RPC: Support first param name in GetParamIndex (and Arg<T>)
Prior to this change, if any parameter had multiple names, the RPC call would fail
1 parent 1248d0d commit 0c7ac92

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/rpc/util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ std::vector<std::pair<std::string, bool>> RPCHelpMan::GetArgNames() const
766766
size_t RPCHelpMan::GetParamIndex(std::string_view key) const
767767
{
768768
auto it{std::find_if(
769-
m_args.begin(), m_args.end(), [&key](const auto& arg) { return arg.GetName() == key;}
769+
m_args.begin(), m_args.end(), [&key](const auto& arg) { return arg.GetFirstName() == key;}
770770
)};
771771

772772
CHECK_NONFATAL(it != m_args.end()); // TODO: ideally this is checked at compile time

0 commit comments

Comments
 (0)