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

Method contains

src/common/bloom.cpp:68–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68bool CBloomFilter::contains(Span<const unsigned char> vKey) const
69{
70 if (vData.empty()) // Avoid divide-by-zero (CVE-2013-5700)
71 return true;
72 for (unsigned int i = 0; i < nHashFuncs; i++)
73 {
74 unsigned int nIndex = Hash(i, vKey);
75 // Checks bit nIndex of vData
76 if (!(vData[nIndex >> 3] & (1 << (7 & nIndex))))
77 return false;
78 }
79 return true;
80}
81
82bool CBloomFilter::contains(const COutPoint& outpoint) const
83{

Callers 15

IsDiscouragedMethod · 0.45
PushAddressFunction · 0.45
AlreadyHaveTxMethod · 0.45
FindTxForGetDataMethod · 0.45
ProcessGetDataMethod · 0.45
ProcessMessageMethod · 0.45
MaybeSendAddrMethod · 0.45
SendMessagesMethod · 0.45
CheckInputScriptsFunction · 0.45
PushTxInventoryMethod · 0.45
GetMethod · 0.45
BOOST_AUTO_TEST_CASEFunction · 0.45

Calls 6

MakeUCharSpanFunction · 0.85
RollingBloomHashFunction · 0.85
FastRange32Function · 0.85
HashFunction · 0.50
emptyMethod · 0.45
sizeMethod · 0.45

Tested by 9

BOOST_AUTO_TEST_CASEFunction · 0.36
BOOST_AUTO_TEST_CASEFunction · 0.36
test_cacheFunction · 0.36
test_cache_eraseFunction · 0.36
test_cache_generationsFunction · 0.36
FUZZ_TARGETFunction · 0.36
FUZZ_TARGETFunction · 0.36
FUZZ_TARGETFunction · 0.36