MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / FindRandomFrom

Function FindRandomFrom

src/test/coins_tests.cpp:262–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260UtxoData utxoData;
261
262UtxoData::iterator FindRandomFrom(const std::set<COutPoint> &utxoSet) {
263 assert(utxoSet.size());
264 auto utxoSetIt = utxoSet.lower_bound(COutPoint(InsecureRand256(), 0));
265 if (utxoSetIt == utxoSet.end()) {
266 utxoSetIt = utxoSet.begin();
267 }
268 auto utxoDataIt = utxoData.find(*utxoSetIt);
269 assert(utxoDataIt != utxoData.end());
270 return utxoDataIt;
271}
272
273
274// 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
COutPointClass · 0.50
sizeMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected