diff options
-rw-r--r-- | src/rpc/util.cpp | 5 | ||||
-rw-r--r-- | src/rpc/util.h | 1 |
2 files changed, 6 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(); } diff --git a/src/rpc/util.h b/src/rpc/util.h index d43ee33b0f..352a3e4e4e 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -240,6 +240,7 @@ struct RPCResult { STR_AMOUNT, //!< Special string to represent a floating point amount STR_HEX, //!< Special string with only hex chars OBJ_DYN, //!< Special dictionary with keys that are not literals + OBJ_EMPTY, //!< Special type to allow empty OBJ 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 (...) |