diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 0e0da8f22b122..ab239fe79c9b1 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -424,7 +424,7 @@ static RPCHelpMan mockscheduler() // check params are valid values RPCTypeCheck(request.params, {UniValue::VNUM}); int64_t delta_seconds = request.params[0].get_int64(); - if ((delta_seconds <= 0) || (delta_seconds > 3600)) { + if (delta_seconds <= 0 || delta_seconds > 3600) { throw std::runtime_error("delta_time must be between 1 and 3600 seconds (1 hr)"); } diff --git a/src/scheduler.cpp b/src/scheduler.cpp index b3ee23f139749..02ada969a469f 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -80,7 +81,7 @@ void CScheduler::schedule(CScheduler::Function f, std::chrono::system_clock::tim void CScheduler::MockForward(std::chrono::seconds delta_seconds) { - assert(delta_seconds.count() > 0 && delta_seconds < std::chrono::hours{1}); + assert(delta_seconds > 0s && delta_seconds <= 1h); { LOCK(newTaskMutex);