MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / initMapping

Method initMapping

src/compacttxfinder.cpp:14–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void CompactTxFinder::initMapping(uint64_t idk0, uint64_t idk1) {
15
16 std::vector<uint256> hashes;
17 mempool.queryHashes(hashes);
18
19 for (auto& t : hashes) {
20 uint64_t shortID = GetShortID(idk0, idk1, t);
21
22 if (mappedMempool.count(shortID)) {
23
24 LogPrint("thin", "ShortID hash collision in mempool");
25
26 // Erase, so the tx re-fetched from peer instead.
27 mappedMempool.erase(shortID);
28 continue;
29 }
30 mappedMempool[shortID] = t;
31 }
32}
33
34CTransaction CompactTxFinder::operator()(const ThinTx& hash) const {
35

Callers

nothing calls this directly

Calls 4

GetShortIDFunction · 0.85
queryHashesMethod · 0.80
countMethod · 0.80
eraseMethod · 0.45

Tested by

no test coverage detected