Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show All 17 Lines | |||||
#include "validation.h" | #include "validation.h" | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
#include "wallet/wallet.h" | #include "wallet/wallet.h" | ||||
#include "wallet/walletdb.h" | #include "wallet/walletdb.h" | ||||
#endif | #endif | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <boost/assign/list_of.hpp> | |||||
#include <univalue.h> | #include <univalue.h> | ||||
/** | /** | ||||
* @note Do not add or change anything in the information returned by this | * @note Do not add or change anything in the information returned by this | ||||
* method. `getinfo` exists for backwards-compatibility only. It combines | * method. `getinfo` exists for backwards-compatibility only. It combines | ||||
* information from wildly different sources in the program, which is a mess, | * information from wildly different sources in the program, which is a mess, | ||||
* and is thus planned to be deprecated eventually. | * and is thus planned to be deprecated eventually. | ||||
* | * | ||||
▲ Show 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | static UniValue setmocktime(const Config &config, | ||||
// For now, don't change mocktime if we're in the middle of validation, as | // For now, don't change mocktime if we're in the middle of validation, as | ||||
// this could have an effect on mempool time-based eviction, as well as | // this could have an effect on mempool time-based eviction, as well as | ||||
// IsCurrentForFeeEstimation() and IsInitialBlockDownload(). | // IsCurrentForFeeEstimation() and IsInitialBlockDownload(). | ||||
// TODO: figure out the right way to synchronize around mocktime, and | // TODO: figure out the right way to synchronize around mocktime, and | ||||
// ensure all callsites of GetTime() are accessing this safely. | // ensure all callsites of GetTime() are accessing this safely. | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM)); | RPCTypeCheck(request.params, {UniValue::VNUM}); | ||||
SetMockTime(request.params[0].get_int64()); | SetMockTime(request.params[0].get_int64()); | ||||
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); | ||||
▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines |