aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/rpc.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-12-08 14:22:48 +0100
committerMarcoFalke <falke.marco@gmail.com>2021-12-08 14:20:16 +0100
commitfa77f95c2ff4ae7761208d06bcbeb59650612367 (patch)
tree3246ff56ec34c154cb49f5aaea19d3f7710b7158 /src/test/fuzz/rpc.cpp
parent577bd51a4b8de066466a445192c1c653872657e2 (diff)
downloadbitcoin-fa77f95c2ff4ae7761208d06bcbeb59650612367.tar.xz
fuzz: Fix RPC internal bug detection
Diffstat (limited to 'src/test/fuzz/rpc.cpp')
-rw-r--r--src/test/fuzz/rpc.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/fuzz/rpc.cpp b/src/test/fuzz/rpc.cpp
index 44b98f7852..b6ecf1c492 100644
--- a/src/test/fuzz/rpc.cpp
+++ b/src/test/fuzz/rpc.cpp
@@ -360,7 +360,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);
}