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

@ -484,9 +484,8 @@ static RPCHelpMan mockscheduler()
throw std::runtime_error("delta_time must be between 1 and 3600 seconds (1 hr)");
}
auto node_context = util::AnyPtr<NodeContext>(request.context);
auto node_context = CHECK_NONFATAL(util::AnyPtr<NodeContext>(request.context));
// protect against null pointer dereference
CHECK_NONFATAL(node_context);
CHECK_NONFATAL(node_context->scheduler);
node_context->scheduler->MockForward(std::chrono::seconds(delta_seconds));