aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2021-12-13 13:24:17 +0700
committerSjors Provoost <sjors@sprovoost.nl>2021-12-24 16:28:53 +0100
commit8d1a3e6498de6087501969a9d243b0697ca3fe97 (patch)
tree78680f3559833bc5b8a151d721b0c8a140fad1d6 /src/rpc/util.cpp
parentbfbf91d0b2004dde358253ac174982f784b43b59 (diff)
downloadbitcoin-8d1a3e6498de6087501969a9d243b0697ca3fe97.tar.xz
rpc: allow empty JSON object result
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp5
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();
}