diff options
| author | Cory Fields <[email protected]> | 2016-04-16 19:13:12 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2016-09-08 12:24:06 -0400 |
| commit | 53347f0cb99e514815e44a56439a4a10012238f8 (patch) | |
| tree | fc5baefe46ef918143904a299fd8aa5083097eda /src/rpc/misc.cpp | |
| parent | net: Add most functions needed for vNodes to CConnman (diff) | |
| download | discoin-53347f0cb99e514815e44a56439a4a10012238f8.tar.xz discoin-53347f0cb99e514815e44a56439a4a10012238f8.zip | |
net: create generic functor accessors and move vNodes to CConnman
Diffstat (limited to 'src/rpc/misc.cpp')
| -rw-r--r-- | src/rpc/misc.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index f9f161561..ffd377b48 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -472,14 +472,17 @@ UniValue setmocktime(const UniValue& params, bool fHelp) // atomically with the time change to prevent peers from being // disconnected because we think we haven't communicated with them // in a long time. - LOCK2(cs_main, cs_vNodes); + LOCK(cs_main); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)); SetMockTime(params[0].get_int64()); uint64_t t = GetTime(); - BOOST_FOREACH(CNode* pnode, vNodes) { - pnode->nLastSend = pnode->nLastRecv = t; + if(g_connman) { + g_connman->ForEachNode([t](CNode* pnode) { + pnode->nLastSend = pnode->nLastRecv = t; + return true; + }); } return NullUniValue; |