From 3764dec36c815267174951a4c64e17c07ee6302f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 26 Mar 2016 18:58:00 +0100 Subject: Keep addrman's nService bits consistent with outbound observations --- src/addrman.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/addrman.cpp') diff --git a/src/addrman.cpp b/src/addrman.cpp index 00f6fe99e..d1e98d8ac 100644 --- a/src/addrman.cpp +++ b/src/addrman.cpp @@ -502,6 +502,24 @@ void CAddrMan::Connected_(const CService& addr, int64_t nTime) info.nTime = nTime; } +void CAddrMan::SetServices_(const CService& addr, uint64_t nServices) +{ + CAddrInfo* pinfo = Find(addr); + + // if not found, bail out + if (!pinfo) + return; + + CAddrInfo& info = *pinfo; + + // check whether we are talking about the exact same CService (including same port) + if (info != addr) + return; + + // update info + info.nServices = nServices; +} + int CAddrMan::RandomInt(int nMax){ return GetRandInt(nMax); } -- cgit v1.2.3