MCPcopy Create free account
hub / github.com/ElementsProject/elements / CheckExpired

Method CheckExpired

src/test/txrequest_tests.cpp:177–186  ·  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

175 * Every expected expiration should be accounted for through exactly one call to this function.
176 */
177 void CheckExpired(NodeId peer, GenTxid gtxid)
178 {
179 const auto& testname = m_testname;
180 auto& runner = m_runner;
181 runner.actions.emplace_back(m_now, [=,&runner]() {
182 auto it = runner.expired.find(std::pair<NodeId, GenTxid>{peer, gtxid});
183 BOOST_CHECK_MESSAGE(it != runner.expired.end(), "[" + testname + "] missing expiration");
184 if (it != runner.expired.end()) runner.expired.erase(it);
185 });
186 }
187
188 /** Generate a random txhash, whose priorities for certain peers are constrained.
189 *

Callers 4

BuildSingleTestFunction · 0.80
BuildWtxidTestFunction · 0.80
BuildTimeBackwardsTestFunction · 0.80
BuildWeirdRequestsTestFunction · 0.80

Calls 4

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

Tested by

no test coverage detected