Skip to content

Commit ab086e0

Browse files
committed
Merge pull request #3422
daa6b20 Unittests for uint256.h (Thomas Holenstein) e85e19b Changed Get64(.) to GetLow64() (Thomas Holenstein)
2 parents a867f45 + daa6b20 commit ab086e0

File tree

5 files changed

+628
-193
lines changed

5 files changed

+628
-193
lines changed

src/addrman.cpp

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

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

@@ -29,11 +29,11 @@ int CAddrInfo::GetNewBucket(const std::vector<unsigned char> &nKey, const CNetAd
2929
std::vector<unsigned char> vchGroupKey = GetGroup();
3030
std::vector<unsigned char> vchSourceGroupKey = src.GetGroup();
3131
ss1 << nKey << vchGroupKey << vchSourceGroupKey;
32-
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).Get64();
32+
uint64_t hash1 = Hash(ss1.begin(), ss1.end()).GetLow64();
3333

3434
CDataStream ss2(SER_GETHASH, 0);
3535
ss2 << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP);
36-
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).Get64();
36+
uint64_t hash2 = Hash(ss2.begin(), ss2.end()).GetLow64();
3737
return hash2 % ADDRMAN_NEW_BUCKET_COUNT;
3838
}
3939

src/test/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_bitcoin_SOURCES = alert_tests.cpp \
3434
key_tests.cpp miner_tests.cpp mruset_tests.cpp multisig_tests.cpp \
3535
netbase_tests.cpp pmt_tests.cpp rpc_tests.cpp script_P2SH_tests.cpp \
3636
script_tests.cpp serialize_tests.cpp sigopcount_tests.cpp test_bitcoin.cpp \
37-
transaction_tests.cpp uint160_tests.cpp uint256_tests.cpp util_tests.cpp \
37+
transaction_tests.cpp uint256_tests.cpp util_tests.cpp \
3838
sighash_tests.cpp $(JSON_TEST_FILES) $(RAW_TEST_FILES)
3939

4040
if ENABLE_WALLET

src/test/uint160_tests.cpp

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)