mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
fuzz: Use C++20 starts_with in rpc.cpp
This commit is contained in:
parent
faa48388bc
commit
fa6e50d6c7
1 changed files with 1 additions and 3 deletions
|
@ -380,9 +380,7 @@ FUZZ_TARGET(rpc, .init = initialize_rpc)
|
|||
rpc_testing_setup->CallRPC(rpc_command, arguments);
|
||||
} catch (const UniValue& json_rpc_error) {
|
||||
const std::string error_msg{json_rpc_error.find_value("message").get_str()};
|
||||
// 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)) {
|
||||
if (error_msg.starts_with("Internal bug detected")) {
|
||||
// Only allow the intentional internal bug
|
||||
assert(error_msg.find("trigger_internal_bug") != std::string::npos);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue