aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorSuhail Saqan <suhailsaqan@users.noreply.github.com>2022-05-17 14:44:20 -0700
committerSuhail Saqan <suhailsaqan@users.noreply.github.com>2022-05-18 10:50:59 -0700
commitb953ea6cc691ba61bf08eb186e76e7e8b7ba8120 (patch)
tree26a896590ceb5d383c017eb2df56cd85be9630f6 /src/rpc/util.cpp
parent002411dc53753b52fef645484258e8baf41585a1 (diff)
rpc: Put undocumented JSON failure mode behind a runtime flag
rpc: Put undocumented JSON failure mode behind a runtime flag
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index ef3e58494e..48ce33e7eb 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -12,6 +12,7 @@
#include <util/check.h>
#include <util/strencodings.h>
#include <util/string.h>
+#include <util/system.h>
#include <util/translation.h>
#include <tuple>
@@ -581,7 +582,9 @@ UniValue RPCHelpMan::HandleRequest(const JSONRPCRequest& request) const
throw std::runtime_error(ToString());
}
const UniValue ret = m_fun(*this, request);
- CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); }));
+ if (gArgs.GetBoolArg("-rpcdoccheck", DEFAULT_RPC_DOC_CHECK)) {
+ CHECK_NONFATAL(std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); }));
+ }
return ret;
}