mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
net: create generic functor accessors and move vNodes to CConnman
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user