mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-14 02:41:34 +02:00
Bugfix: RPC: Don't use a continuation elipsis after an elision elipsis
This commit is contained in:
parent
eca65caadc
commit
26dcf39581
@ -643,10 +643,10 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
|
|||||||
for (const auto& i : m_inner) {
|
for (const auto& i : m_inner) {
|
||||||
i.ToSections(sections, OuterType::ARR, current_indent + 2);
|
i.ToSections(sections, OuterType::ARR, current_indent + 2);
|
||||||
}
|
}
|
||||||
if (m_type == Type::ARR) {
|
CHECK_NONFATAL(!m_inner.empty());
|
||||||
|
if (m_type == Type::ARR && m_inner.back().m_type != Type::ELISION) {
|
||||||
sections.PushSection({indent_next + "...", ""});
|
sections.PushSection({indent_next + "...", ""});
|
||||||
} else {
|
} else {
|
||||||
CHECK_NONFATAL(!m_inner.empty());
|
|
||||||
// Remove final comma, which would be invalid JSON
|
// Remove final comma, which would be invalid JSON
|
||||||
sections.m_sections.back().m_left.pop_back();
|
sections.m_sections.back().m_left.pop_back();
|
||||||
}
|
}
|
||||||
@ -659,11 +659,11 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const
|
|||||||
for (const auto& i : m_inner) {
|
for (const auto& i : m_inner) {
|
||||||
i.ToSections(sections, OuterType::OBJ, current_indent + 2);
|
i.ToSections(sections, OuterType::OBJ, current_indent + 2);
|
||||||
}
|
}
|
||||||
if (m_type == Type::OBJ_DYN) {
|
CHECK_NONFATAL(!m_inner.empty());
|
||||||
|
if (m_type == Type::OBJ_DYN && m_inner.back().m_type != Type::ELISION) {
|
||||||
// If the dictionary keys are dynamic, use three dots for continuation
|
// If the dictionary keys are dynamic, use three dots for continuation
|
||||||
sections.PushSection({indent_next + "...", ""});
|
sections.PushSection({indent_next + "...", ""});
|
||||||
} else {
|
} else {
|
||||||
CHECK_NONFATAL(!m_inner.empty());
|
|
||||||
// Remove final comma, which would be invalid JSON
|
// Remove final comma, which would be invalid JSON
|
||||||
sections.m_sections.back().m_left.pop_back();
|
sections.m_sections.back().m_left.pop_back();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user