rpc: render Type::ANY in help text instead of aborting

RPCResult::Type::ANY triggers NONFATAL_UNREACHABLE() in ToSections(),
which crashes the help() RPC when a command uses Type::ANY in a
nested result field.

Previously this was never hit because Type::ANY was only used as a
top-level alternate result type, filtered out before ToSections() is
called.

getopenrpcinfo() will use this result type, so render it like other
types allowing it to be used in nested result definitions like schema.
This commit is contained in:
will
2026-03-03 21:04:38 +00:00
parent 06de34a033
commit 6a1a66c180

View File

@@ -1032,7 +1032,8 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
switch (m_type) {
case Type::ANY: {
NONFATAL_UNREACHABLE(); // Only for testing
sections.PushSection({indent + maybe_key + "xxx" + maybe_separator, Description("any")});
return;
}
case Type::NONE: {
sections.PushSection({indent + "null" + maybe_separator, Description("json null")});