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

Method CheckExpired

src/test/txrequest_tests.cpp:194–203  ·  view source on GitHub ↗

Verify that an announcement for gtxid by peer has expired some time before this check is scheduled. * * Every expected expiration should be accounted for through exactly one call to this function. */

Source from the content-addressed store, hash-verified

192 * Every expected expiration should be accounted for through exactly one call to this function.
193 */
194 void CheckExpired(NodeId peer, GenTxid gtxid)
195 {
196 const auto& testname = m_testname;
197 auto& runner = m_runner;
198 runner.actions.emplace_back(m_now, [=, &runner]() {
199 auto it = runner.expired.find(std::pair<NodeId, GenTxid>{peer, gtxid});
200 BOOST_CHECK_MESSAGE(it != runner.expired.end(), "[" + testname + "] missing expiration");
201 if (it != runner.expired.end()) runner.expired.erase(it);
202 });
203 }
204
205 /** Generate a random txhash, whose priorities for certain peers are constrained.
206 *

Callers 4

BuildSingleTestMethod · 0.80
BuildWtxidTestMethod · 0.80

Calls 4

findMethod · 0.80
emplace_backMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected