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

Function FindRandomFrom

src/test/coins_tests.cpp:280–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278UtxoData utxoData;
279
280UtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) {
281 assert(utxoSet.size());
282 auto utxoSetIt = utxoSet.lower_bound(COutPoint(InsecureRand256(), 0));
283 if (utxoSetIt == utxoSet.end()) {
284 utxoSetIt = utxoSet.begin();
285 }
286 auto utxoDataIt = utxoData.find(*utxoSetIt);
287 assert(utxoDataIt != utxoData.end());
288 return utxoDataIt;
289}
290
291
292// This test is similar to the previous test

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.85

Calls 7

InsecureRand256Function · 0.85
lower_boundMethod · 0.80
findMethod · 0.80
COutPointClass · 0.50
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected