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

Method FillShortTxIDSelector

src/blockencodings.cpp:55–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void CompactBlock::FillShortTxIDSelector() const {
56 CDataStream stream(SER_NETWORK, PROTOCOL_VERSION);
57 stream << header << nonce;
58 CSHA256 hasher;
59 hasher.Write((unsigned char*)&(*stream.begin()), stream.end() - stream.begin());
60 uint256 shorttxidhash;
61 hasher.Finalize(shorttxidhash.begin());
62 shorttxidk0 = shorttxidhash.GetUint64(0);
63 shorttxidk1 = shorttxidhash.GetUint64(1);
64}
65
66uint64_t CompactBlock::GetShortID(const uint256& txhash) const {
67 return ::GetShortID(shorttxidk0, shorttxidk1, txhash);

Callers

nothing calls this directly

Calls 5

GetUint64Method · 0.80
WriteMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
FinalizeMethod · 0.45

Tested by

no test coverage detected