util/check: Add CHECK_NONFATAL identity function, NONFATAL_UNREACHABLE AND UNREACHABLE macros

This commit is contained in:
Aurèle Oulès
2022-04-09 02:14:02 +02:00
parent e0680bbce8
commit ee02c8bd9a
7 changed files with 49 additions and 39 deletions

View File

@@ -33,6 +33,7 @@
#include <script/standard.h>
#include <uint256.h>
#include <util/bip32.h>
#include <util/check.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <util/vector.h>
@@ -466,7 +467,7 @@ static RPCHelpMan decodescript()
// Should not be wrapped
return false;
} // no default case, so the compiler can warn about missing cases
CHECK_NONFATAL(false);
NONFATAL_UNREACHABLE();
}()};
if (can_wrap_P2WSH) {
UniValue sr(UniValue::VOBJ);