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

Function random_outpoints

src/test/txvalidation_tests.cpp:58–64  ·  view source on GitHub ↗

Generate a number of random, nonexistent outpoints.

Source from the content-addressed store, hash-verified

56
57// Generate a number of random, nonexistent outpoints.
58static inline std::vector<COutPoint> random_outpoints(size_t num_outpoints) {
59 std::vector<COutPoint> outpoints;
60 for (size_t i{0}; i < num_outpoints; ++i) {
61 outpoints.emplace_back(Txid::FromUint256(GetRandHash()), 0);
62 }
63 return outpoints;
64}
65
66static inline std::vector<CPubKey> random_keys(size_t num_keys) {
67 std::vector<CPubKey> keys;

Callers 1

BOOST_FIXTURE_TEST_CASEFunction · 0.85

Calls 2

GetRandHashFunction · 0.85
emplace_backMethod · 0.45

Tested by

no test coverage detected