Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show First 20 Lines • Show All 472 Lines • ▼ Show 20 Lines | static UniValue mockscheduler(const Config &config, | ||||
if ((delta_seconds <= 0) || (delta_seconds > 3600)) { | if ((delta_seconds <= 0) || (delta_seconds > 3600)) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"delta_time must be between 1 and 3600 seconds (1 hr)"); | "delta_time must be between 1 and 3600 seconds (1 hr)"); | ||||
} | } | ||||
// protect against null pointer dereference | // protect against null pointer dereference | ||||
CHECK_NONFATAL(g_rpc_node); | CHECK_NONFATAL(g_rpc_node); | ||||
CHECK_NONFATAL(g_rpc_node->scheduler); | CHECK_NONFATAL(g_rpc_node->scheduler); | ||||
g_rpc_node->scheduler->MockForward(boost::chrono::seconds(delta_seconds)); | g_rpc_node->scheduler->MockForward(std::chrono::seconds(delta_seconds)); | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
static UniValue RPCLockedMemoryInfo() { | static UniValue RPCLockedMemoryInfo() { | ||||
LockedPool::Stats stats = LockedPoolManager::Instance().stats(); | LockedPool::Stats stats = LockedPoolManager::Instance().stats(); | ||||
UniValue obj(UniValue::VOBJ); | UniValue obj(UniValue::VOBJ); | ||||
obj.pushKV("used", uint64_t(stats.used)); | obj.pushKV("used", uint64_t(stats.used)); | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |