Skip to content

Commit

Permalink
Merge 926fc2a into merged_master (Bitcoin PR bitcoin/bitcoin#23707)
Browse files Browse the repository at this point in the history
  • Loading branch information
delta1 committed Jun 6, 2023
2 parents 8436894 + 926fc2a commit c7c59a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/test/fuzz/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,9 @@ FUZZ_TARGET_INIT(rpc, initialize_rpc)
rpc_testing_setup->CallRPC(rpc_command, arguments);
} catch (const UniValue& json_rpc_error) {
const std::string error_msg{find_value(json_rpc_error, "message").get_str()};
if (error_msg.find("Internal bug detected") != std::string::npos) {
// Once c++20 is allowed, starts_with can be used.
// if (error_msg.starts_with("Internal bug detected")) {
if (0 == error_msg.rfind("Internal bug detected", 0)) {
// Only allow the intentional internal bug
assert(error_msg.find("trigger_internal_bug") != std::string::npos);
}
Expand Down
6 changes: 3 additions & 3 deletions src/util/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ class NonFatalCheckError : public std::runtime_error
do { \
if (!(condition)) { \
throw NonFatalCheckError( \
strprintf("%s:%d (%s)\n" \
"Internal bug detected: '%s'\n" \
strprintf("Internal bug detected: '%s'\n" \
"%s:%d (%s)\n" \
"You may report this issue here: %s\n", \
__FILE__, __LINE__, __func__, \
(#condition), \
__FILE__, __LINE__, __func__, \
PACKAGE_BUGREPORT)); \
} \
} while (false)
Expand Down

0 comments on commit c7c59a2

Please sign in to comment.