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

Method GetCoin

src/test/coins_tests.cpp:41–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40public:
41 [[nodiscard]] bool GetCoin(const COutPoint& outpoint, Coin& coin) const override
42 {
43 std::map<COutPoint, Coin>::const_iterator it = map_.find(outpoint);
44 if (it == map_.end()) {
45 return false;
46 }
47 coin = it->second;
48 if (coin.IsSpent() && InsecureRandBool() == 0) {
49 // Randomly return false in case of an empty entry.
50 return false;
51 }
52 return true;
53 }
54
55 uint256 GetBestBlock() const override { return hashBestBlock_; }
56

Callers 7

BOOST_AUTO_TEST_CASEFunction · 0.45
FUZZ_TARGET_INITFunction · 0.45
FUZZ_TARGET_INITFunction · 0.45
gettxoutFunction · 0.45
FindCoinsFunction · 0.45
getUnspentOutputMethod · 0.45

Calls 4

InsecureRandBoolFunction · 0.85
findMethod · 0.80
endMethod · 0.45
IsSpentMethod · 0.45

Tested by

no test coverage detected