diff options
author | MarcoFalke <falke.marco@gmail.com> | 2019-09-23 14:45:51 -0400 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2019-10-18 17:19:36 -0400 |
commit | faeb6665362e35f573ad715ade0ef2db62d71839 (patch) | |
tree | 45850a75344361ee5537510375d363e9367d00ab /src/rpc/util.h | |
parent | 0ff7cd7d0c074448db636bcc73e7879b7e4b21ec (diff) |
util: Add CHECK_NONFATAL and use it in src/rpc
Diffstat (limited to 'src/rpc/util.h')
-rw-r--r-- | src/rpc/util.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rpc/util.h b/src/rpc/util.h index 72fc7b6286..ec36956c95 100644 --- a/src/rpc/util.h +++ b/src/rpc/util.h @@ -7,14 +7,15 @@ #include <node/transaction.h> #include <outputtype.h> -#include <pubkey.h> #include <protocol.h> +#include <pubkey.h> #include <rpc/protocol.h> #include <rpc/request.h> #include <script/script.h> #include <script/sign.h> #include <script/standard.h> #include <univalue.h> +#include <util/check.h> #include <string> #include <vector> @@ -146,7 +147,7 @@ struct RPCArg { m_oneline_description{oneline_description}, m_type_str{type_str} { - assert(type != Type::ARR && type != Type::OBJ); + CHECK_NONFATAL(type != Type::ARR && type != Type::OBJ); } RPCArg( @@ -165,7 +166,7 @@ struct RPCArg { m_oneline_description{oneline_description}, m_type_str{type_str} { - assert(type == Type::ARR || type == Type::OBJ); + CHECK_NONFATAL(type == Type::ARR || type == Type::OBJ); } bool IsOptional() const; @@ -194,14 +195,14 @@ struct RPCResult { explicit RPCResult(std::string result) : m_cond{}, m_result{std::move(result)} { - assert(!m_result.empty()); + CHECK_NONFATAL(!m_result.empty()); } RPCResult(std::string cond, std::string result) : m_cond{std::move(cond)}, m_result{std::move(result)} { - assert(!m_cond.empty()); - assert(!m_result.empty()); + CHECK_NONFATAL(!m_cond.empty()); + CHECK_NONFATAL(!m_result.empty()); } }; |