From 6b6aaa1698838278a547f16a15e635bd58ec867d Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 16 Apr 2012 14:56:45 +0200 Subject: Further reduce header dependencies This commit removes the dependency of serialize.h on PROTOCOL_VERSION, and makes this parameter required instead of implicit. This is much saner, as it makes the places where changing a version number can have an influence obvious. --- src/addrman.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/addrman.cpp') diff --git a/src/addrman.cpp b/src/addrman.cpp index 11dd2a7b7d..345261e229 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -8,12 +8,12 @@ using namespace std; int CAddrInfo::GetTriedBucket(const std::vector &nKey) const { - CDataStream ss1(SER_GETHASH); + CDataStream ss1(SER_GETHASH, 0); std::vector vchKey = GetKey(); ss1 << nKey << vchKey; uint64 hash1 = Hash(ss1.begin(), ss1.end()).Get64(); - CDataStream ss2(SER_GETHASH); + CDataStream ss2(SER_GETHASH, 0); std::vector 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 &nKey) const int CAddrInfo::GetNewBucket(const std::vector &nKey, const CNetAddr& src) const { - CDataStream ss1(SER_GETHASH); + CDataStream ss1(SER_GETHASH, 0); std::vector vchGroupKey = GetGroup(); std::vector 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; -- cgit v1.2.3