aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/util.cpp
diff options
context:
space:
mode:
authorAdam Jonas <jonas@chaincode.com>2019-10-29 16:26:01 -0400
committerAdam Jonas <jonas@chaincode.com>2019-10-30 12:03:07 -0400
commitc98bd13e675fbf5641ed64d551b63aaf55a1a8e9 (patch)
treede1e060178eb8efa14291ca328c26b82323b5976 /src/rpc/util.cpp
parentedd9d0781b96e71f88bd87b30dd10ad008b964a5 (diff)
downloadbitcoin-c98bd13e675fbf5641ed64d551b63aaf55a1a8e9.tar.xz
replace asserts in RPC code with CHECK_NONFATAL and add linter
Diffstat (limited to 'src/rpc/util.cpp')
-rw-r--r--src/rpc/util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 653b287e97..cfa3509c65 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -428,7 +428,7 @@ RPCHelpMan::RPCHelpMan(std::string name, std::string description, std::vector<RP
std::set<std::string> named_args;
for (const auto& arg : m_args) {
// Should have unique named arguments
- assert(named_args.insert(arg.m_name).second);
+ CHECK_NONFATAL(named_args.insert(arg.m_name).second);
}
}
@@ -620,11 +620,11 @@ std::string RPCArg::ToStringObj(const bool oneline) const
case Type::OBJ:
case Type::OBJ_USER_KEYS:
// Currently unused, so avoid writing dead code
- assert(false);
+ CHECK_NONFATAL(false);
// no default case, so the compiler can warn about missing cases
}
- assert(false);
+ CHECK_NONFATAL(false);
}
std::string RPCArg::ToString(const bool oneline) const
@@ -661,7 +661,7 @@ std::string RPCArg::ToString(const bool oneline) const
// no default case, so the compiler can warn about missing cases
}
- assert(false);
+ CHECK_NONFATAL(false);
}
static std::pair<int64_t, int64_t> ParseRange(const UniValue& value)