| 53 | } |
| 54 | |
| 55 | void 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 | |
| 66 | uint64_t CompactBlock::GetShortID(const uint256& txhash) const { |
| 67 | return ::GetShortID(shorttxidk0, shorttxidk1, txhash); |