diff options
| author | Pieter Wuille <[email protected]> | 2012-04-17 11:04:29 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-04-17 11:04:29 -0700 |
| commit | 1ffeb89a52d82bb62860786ff6426224437ca7b1 (patch) | |
| tree | 62a79e33a866c2a92f548cecb6148c7339f8beaf /src/addrman.cpp | |
| parent | Merge pull request #1106 from jgarzik/sign-compare (diff) | |
| parent | Further reduce header dependencies (diff) | |
| download | discoin-1ffeb89a52d82bb62860786ff6426224437ca7b1.tar.xz discoin-1ffeb89a52d82bb62860786ff6426224437ca7b1.zip | |
Merge pull request #1112 from sipa/saneserial
Further reduce header dependencies
Diffstat (limited to 'src/addrman.cpp')
| -rw-r--r-- | src/addrman.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp index 11dd2a7b7..345261e22 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -8,12 +8,12 @@ using namespace std; int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const { - CDataStream ss1(SER_GETHASH); + CDataStream ss1(SER_GETHASH, 0); std::vector<unsigned char> vchKey = GetKey(); ss1 << nKey << vchKey; uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64(); - CDataStream ss2(SER_GETHASH); + CDataStream ss2(SER_GETHASH, 0); std::vector<unsigned char> vchGroupKey = GetGroup(); ss2 << nKey << vchGroupKey << (hash1 % ADDRMAN_TRIED_BUCKETS_PER_GROUP); uint64 hash2 = Hash(ss2.begin(), ss2.end()).Get64(); @@ -22,13 +22,13 @@ int CAddrInfo::GetTriedBucket(const std::vector<unsigned char> &nKey) const int CAddrInfo::GetNewBucket(const std::vector<unsigned char> &nKey, const CNetAddr& src) const { - CDataStream ss1(SER_GETHASH); + CDataStream ss1(SER_GETHASH, 0); std::vector<unsigned char> vchGroupKey = GetGroup(); std::vector<unsigned char> vchSourceGroupKey = src.GetGroup(); ss1 << nKey << vchGroupKey << vchSourceGroupKey; uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64(); - CDataStream ss2(SER_GETHASH); + CDataStream ss2(SER_GETHASH, 0); ss2 << nKey << vchSourceGroupKey << (hash1 % ADDRMAN_NEW_BUCKETS_PER_SOURCE_GROUP); uint64 hash2 = Hash(ss2.begin(), ss2.end()).Get64(); return hash2 % ADDRMAN_NEW_BUCKET_COUNT; |