rpc: remove unused RPCResult::Type::ELISION
What changed, and why it matters
This commit removes an unused internal code label called ELISION from Bitcoin Core's RPC documentation helper code. It only affects how RPC help text is generated and has no impact on transaction processing, wallet funds, network behavior, or security.
No security action needed. This is a benign refactoring commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch deletes RPCResult::Type::ELISION and all associated branches in src/rpc/util.cpp and src/rpc/util.h. ELISION was a documentation-only marker used to render ‘…’ in human-readable RPC help output. It had no runtime effect on RPC parsing, validation, consensus, or networking. The removal is a code-cleanup change because the value was no longer used after prior refactoring.
Changed components
src/rpc/util.cppsrc/rpc/util.hInspect captured patch +2 / −10
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index e96a19b4..f0afa5c9 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -1031,11 +1031,6 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
}
switch (m_type) {
- case Type::ELISION: {
- // Deprecated alias of m_opts.print_elision
- sections.PushSection({indent + "..." + maybe_separator, m_description});
- return;
- }
case Type::ANY: {
NONFATAL_UNREACHABLE(); // Only for testing
}
@@ -1075,7 +1070,7 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
}
CHECK_NONFATAL(!m_inner.empty());
CHECK_NONFATAL(elision_has_description(m_inner));
- if (m_type == Type::ARR && m_inner.back().m_type != Type::ELISION && !std::holds_alternative<std::string>(m_inner.back().m_opts.print_elision)) {
+ if (m_type == Type::ARR && !std::holds_alternative<std::string>(m_inner.back().m_opts.print_elision)) {
sections.PushSection({indent_next + "...", ""});
} else {
// Remove final comma, which would be invalid JSON
@@ -1095,7 +1090,7 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
for (const auto& i : m_inner) {
i.ToSections(sections, OuterType::OBJ, current_indent + 2);
}
- if (m_type == Type::OBJ_DYN && m_inner.back().m_type != Type::ELISION) {
+ if (m_type == Type::OBJ_DYN) {
// If the dictionary keys are dynamic, use three dots for continuation
sections.PushSection({indent_next + "...", ""});
} else {
@@ -1113,7 +1108,6 @@ static std::optional<UniValue::VType> ExpectedType(RPCResult::Type type)
{
using Type = RPCResult::Type;
switch (type) {
- case Type::ELISION:
case Type::ANY: {
return std::nullopt;
}
@@ -1171,7 +1165,6 @@ UniValue RPCResult::MatchesType(const UniValue& result) const
}
if (UniValue::VOBJ == result.getType()) {
- if (!m_inner.empty() && m_inner.at(0).m_type == Type::ELISION) return true;
UniValue errors(UniValue::VOBJ);
if (m_type == Type::OBJ_DYN) {
const RPCResult& doc_inner{m_inner.at(0)}; // Assume all types are the same, randomly pick the first
diff --git a/src/rpc/util.h b/src/rpc/util.h
index ce3d507e..9627e945 100644
--- a/src/rpc/util.h
+++ b/src/rpc/util.h
@@ -318,7 +318,6 @@ struct RPCResult {
OBJ_DYN, //!< Special dictionary with keys that are not literals
ARR_FIXED, //!< Special array that has a fixed number of entries
NUM_TIME, //!< Special numeric to denote unix epoch time
- ELISION, //!< Special type to denote elision (...)
};
const Type m_type;
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.