Skip to content

Commit 8076585

Browse files
committed
Replace GetLow64 with GetCheapHash
1 parent 4f15249 commit 8076585

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/addrman.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ int CAddrInfo::GetTriedBucket(const std::vector<unsigned char>& nKey) const
1515
CDataStream ss1(SER_GETHASH, 0);
1616
std::vector<unsigned char> vchKey = GetKey();
1717
ss1 << nKey << vchKey;
18-
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).GetLow64();
18+
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).GetCheapHash();
1919

2020
CDataStream ss2(SER_GETHASH, 0);
2121
std::vector<unsigned char> vchGroupKey = GetGroup();
2222
ss2 << nKey << vchGroupKey << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP);
23-
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).GetLow64();
23+
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).GetCheapHash();
2424
return hash2 % ADDRMAN_TRIED_BUCKET_COUNT;
2525
}
2626

@@ -30,11 +30,11 @@ int CAddrInfo::GetNewBucket(const std::vector<unsigned char>& nKey, const CNetAd
3030
std::vector<unsigned char> vchGroupKey = GetGroup();
3131
std::vector<unsigned char> vchSourceGroupKey = src.GetGroup();
3232
ss1 << nKey << vchGroupKey << vchSourceGroupKey;
33-
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).GetLow64();
33+
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).GetCheapHash();
3434

3535
CDataStream ss2(SER_GETHASH, 0);
3636
ss2 << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP);
37-
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).GetLow64();
37+
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).GetCheapHash();
3838
return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
3939
}
4040

src/main.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static const unsigned char REJECT_CHECKPOINT = 0x43;
106106

107107
struct BlockHasher
108108
{
109-
size_t operator()(const uint256& hash) const { return hash.GetLow64(); }
109+
size_t operator()(const uint256& hash) const { return hash.GetCheapHash(); }
110110
};
111111

112112
extern CScript COINBASE_FLAGS;

0 commit comments

Comments
 (0)