diff options
| author | Wladimir J. van der Laan <[email protected]> | 2017-01-26 09:57:01 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2017-01-26 09:57:45 +0100 |
| commit | 3f9f9629cc1e4d9490dc13615114760e1889d5c6 (patch) | |
| tree | 9fc9c71487eb4414e82183f82a200e8bd7bc842a /src/rpc/misc.cpp | |
| parent | Merge #9628: qa: Increase a sync_blocks timeout in pruning.py (diff) | |
| parent | net: Consistently use GetTimeMicros() for inactivity checks (diff) | |
| download | discoin-3f9f9629cc1e4d9490dc13615114760e1889d5c6.tar.xz discoin-3f9f9629cc1e4d9490dc13615114760e1889d5c6.zip | |
Merge #9606: net: Consistently use GetTimeMicros() for inactivity checks
99464bc net: Consistently use GetTimeMicros() for inactivity checks (Suhas Daftuar)
Diffstat (limited to 'src/rpc/misc.cpp')
| -rw-r--r-- | src/rpc/misc.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 54d8c3e03..480c45516 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; } |