diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2021-12-13 13:24:17 +0700 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2021-12-24 16:28:53 +0100 |
commit | 8d1a3e6498de6087501969a9d243b0697ca3fe97 (patch) | |
tree | 78680f3559833bc5b8a151d721b0c8a140fad1d6 /src/rpc/util.cpp | |
parent | bfbf91d0b2004dde358253ac174982f784b43b59 (diff) | |
download | bitcoin-8d1a3e6498de6087501969a9d243b0697ca3fe97.tar.xz |
rpc: allow empty JSON object result
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r-- | src/rpc/util.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp index 4a5cd0a4be..33b55707eb 100644 --- a/src/rpc/util.cpp +++ b/src/rpc/util.cpp @@ -830,6 +830,10 @@ void RPCResult::ToSections(Sections& sections, const OuterType outer_type, const return; } case Type::OBJ_DYN: + case Type::OBJ_EMPTY: { + sections.PushSection({indent + maybe_key + "{}", Description("empty JSON object")}); + return; + } case Type::OBJ: { sections.PushSection({indent + maybe_key + "{", Description("json object")}); for (const auto& i : m_inner) { @@ -879,6 +883,7 @@ bool RPCResult::MatchesType(const UniValue& result) const return UniValue::VARR == result.getType(); } case Type::OBJ_DYN: + case Type::OBJ_EMPTY: case Type::OBJ: { return UniValue::VOBJ == result.getType(); } |