From 67a42f929b1434f647c63922fd02dc2b93b28060 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 3 Jan 2012 23:33:31 +0100 Subject: Network stack refactor This introduces CNetAddr and CService, respectively wrapping an (IPv6) IP address and an IP+port combination. This functionality used to be part of CAddress, which also contains network flags and connection attempt information. These extra fields are however not always necessary. These classes, along with logic for creating connections and doing name lookups, are moved to netbase.{h,cpp}, which does not depend on headers.h. Furthermore, CNetAddr is mostly IPv6-ready, though IPv6 functionality is not yet enabled for the application itself. --- src/util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util.cpp') diff --git a/src/util.cpp b/src/util.cpp index 3805e077a..ac7bacb7f 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -948,12 +948,12 @@ int64 GetAdjustedTime() return GetTime() + nTimeOffset; } -void AddTimeData(unsigned int ip, int64 nTime) +void AddTimeData(const CNetAddr& ip, int64 nTime) { int64 nOffsetSample = nTime - GetTime(); // Ignore duplicates - static set setKnown; + static set setKnown; if (!setKnown.insert(ip).second) return; @@ -1008,7 +1008,6 @@ void AddTimeData(unsigned int ip, int64 nTime) - string FormatVersion(int nVersion) { if (nVersion%100 == 0) @@ -1178,3 +1177,4 @@ bool CCriticalSection::TryEnter(const char*, const char*, int) } #endif /* DEBUG_LOCKORDER */ + -- cgit v1.2.3