aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/misc.cpp')
-rw-r--r--src/rpc/misc.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index 54d8c3e035..480c45516c 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -431,22 +431,16 @@ UniValue setmocktime(const JSONRPCRequest& request)
if (!Params().MineBlocksOnDemand())
throw runtime_error("setmocktime for regression testing (-regtest mode) only");
- // cs_vNodes is locked and node send/receive times are updated
- // atomically with the time change to prevent peers from being
- // disconnected because we think we haven't communicated with them
- // in a long time.
+ // 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
+ // IsCurrentForFeeEstimation() and IsInitialBlockDownload().
+ // TODO: figure out the right way to synchronize around mocktime, and
+ // ensure all callsites of GetTime() are accessing this safely.
LOCK(cs_main);
RPCTypeCheck(request.params, boost::assign::list_of(UniValue::VNUM));
SetMockTime(request.params[0].get_int64());
- uint64_t t = GetTime();
- if(g_connman) {
- g_connman->ForEachNode([t](CNode* pnode) {
- pnode->nLastSend = pnode->nLastRecv = t;
- });
- }
-
return NullUniValue;
}