From e2093b4fec688536c9fcaa786f8a7312439dec20 Mon Sep 17 00:00:00 2001 From: Bruno Garcia Date: Wed, 3 Jul 2024 09:12:22 -0300 Subject: [PATCH] addrv2: fix clearnet count to include Tor --- targets/addrv2.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/addrv2.cpp b/targets/addrv2.cpp index 653b9f1..8f299ce 100644 --- a/targets/addrv2.cpp +++ b/targets/addrv2.cpp @@ -14,19 +14,19 @@ std::optional> Addrv2Core(Span buff { std::vector addrs; DataStream ds{buffer}; - uint64_t clearnet_count{0}; + uint64_t clearnet_tor_count{0}; try { ds >> CAddress::V2_NETWORK(addrs); if (addrs.size() > 1000) return std::nullopt; for (auto& addr : addrs) { - if (addr.IsIPv4() || addr.IsIPv6()) clearnet_count++; + if (addr.IsIPv4() || addr.IsIPv6() || addr.IsTor()) clearnet_tor_count++; if (!addr.IsValid()) return std::nullopt; } } catch (const std::ios_base::failure&) { return std::nullopt; } - return std::make_pair(addrs.size(), clearnet_count); + return std::make_pair(addrs.size(), clearnet_tor_count); } void Addrv2(FuzzedDataProvider& provider)