From bcd7f30b7944892db7ae37069175804567bb0cdf Mon Sep 17 00:00:00 2001 From: John Newbery Date: Fri, 23 Oct 2020 10:20:48 +0100 Subject: [PATCH] [net] remove CConnman::MarkAddressGood It just forwards calls to CAddrMan::Good. --- src/net.cpp | 5 ----- src/net.h | 1 - src/net_processing.cpp | 2 +- src/test/fuzz/connman.cpp | 7 ------- 4 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 27c64a737e4..0e5909612ed 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2635,11 +2635,6 @@ CConnman::~CConnman() Stop(); } -void CConnman::MarkAddressGood(const CAddress& addr) -{ - addrman.Good(addr); -} - bool CConnman::AddNewAddresses(const std::vector& vAddr, const CAddress& addrFrom, int64_t nTimePenalty) { return addrman.Add(vAddr, addrFrom, nTimePenalty); diff --git a/src/net.h b/src/net.h index 0e4790a226a..f2add667d2b 100644 --- a/src/net.h +++ b/src/net.h @@ -921,7 +921,6 @@ public: }; // Addrman functions - void MarkAddressGood(const CAddress& addr); bool AddNewAddresses(const std::vector& vAddr, const CAddress& addrFrom, int64_t nTimePenalty = 0); std::vector GetAddresses(size_t max_addresses, size_t max_pct); /** diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6942f02a18c..ff1e46eb678 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2476,7 +2476,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type, // // This moves an address from New to Tried table in Addrman, // resolves tried-table collisions, etc. - m_connman.MarkAddressGood(pfrom.addr); + m_addrman.Good(pfrom.addr); } std::string remoteAddr; diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp index 4c4da242625..dec580ea227 100644 --- a/src/test/fuzz/connman.cpp +++ b/src/test/fuzz/connman.cpp @@ -27,7 +27,6 @@ FUZZ_TARGET_INIT(connman, initialize_connman) SetMockTime(ConsumeTime(fuzzed_data_provider)); CAddrMan addrman; CConnman connman{fuzzed_data_provider.ConsumeIntegral(), fuzzed_data_provider.ConsumeIntegral(), addrman, fuzzed_data_provider.ConsumeBool()}; - CAddress random_address; CNetAddr random_netaddr; CNode random_node = ConsumeNode(fuzzed_data_provider); CSubNet random_subnet; @@ -35,9 +34,6 @@ FUZZ_TARGET_INIT(connman, initialize_connman) while (fuzzed_data_provider.ConsumeBool()) { CallOneOf( fuzzed_data_provider, - [&] { - random_address = ConsumeAddress(fuzzed_data_provider); - }, [&] { random_netaddr = ConsumeNetAddr(fuzzed_data_provider); }, @@ -94,9 +90,6 @@ FUZZ_TARGET_INIT(connman, initialize_connman) [&] { (void)connman.GetNodeCount(fuzzed_data_provider.PickValueInArray({ConnectionDirection::None, ConnectionDirection::In, ConnectionDirection::Out, ConnectionDirection::Both})); }, - [&] { - connman.MarkAddressGood(random_address); - }, [&] { (void)connman.OutboundTargetReached(fuzzed_data_provider.ConsumeBool()); },