MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / NewPeer

Method NewPeer

src/test/txrequest_tests.cpp:247–256  ·  view source on GitHub ↗

Generate a new random NodeId to use as peer. The same NodeId is never returned twice * (across all Scenarios combined). */

Source from the content-addressed store, hash-verified

245 /** Generate a new random NodeId to use as peer. The same NodeId is never returned twice
246 * (across all Scenarios combined). */
247 NodeId NewPeer()
248 {
249 bool ok;
250 NodeId ret;
251 do {
252 ret = m_rng.randbits(63);
253 ok = m_runner.peerset.insert(ret).second;
254 } while(!ok);
255 return ret;
256 }
257
258 std::chrono::microseconds Now() const { return m_now; }
259};

Callers 7

BuildSingleTestMethod · 0.80
BuildPriorityTestMethod · 0.80
BuildBigPriorityTestMethod · 0.80
BuildRequestOrderTestMethod · 0.80
BuildWtxidTestMethod · 0.80

Calls 2

randbitsMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected