aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-10-01 17:15:46 +0100
committerJohn Newbery <john@johnnewbery.com>2021-10-28 12:52:27 +0100
commit2658eb6d68460272deefb3fcc653b03f6ec6e7cf (patch)
tree1056a3ef4e7132d91a30bc1c3bd3d8f7f536079b
parente58598e833d5737900fe3c4369e26f2a08166892 (diff)
downloadbitcoin-2658eb6d68460272deefb3fcc653b03f6ec6e7cf.tar.xz
[addrman] Rename Add_() to AddSingle()
-rw-r--r--src/addrman.cpp4
-rw-r--r--src/addrman_impl.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/addrman.cpp b/src/addrman.cpp
index 86f56052c1..b0555898e2 100644
--- a/src/addrman.cpp
+++ b/src/addrman.cpp
@@ -592,7 +592,7 @@ void AddrManImpl::Good_(const CService& addr, bool test_before_evict, int64_t nT
}
}
-bool AddrManImpl::Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty)
+bool AddrManImpl::AddSingle(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty)
{
AssertLockHeld(cs);
@@ -1034,7 +1034,7 @@ bool AddrManImpl::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source
int nAdd = 0;
Check();
for (std::vector<CAddress>::const_iterator it = vAddr.begin(); it != vAddr.end(); it++)
- nAdd += Add_(*it, source, nTimePenalty) ? 1 : 0;
+ nAdd += AddSingle(*it, source, nTimePenalty) ? 1 : 0;
Check();
if (nAdd) {
LogPrint(BCLog::ADDRMAN, "Added %i addresses from %s: %i tried, %i new\n", nAdd, source.ToString(), nTried, nNew);
diff --git a/src/addrman_impl.h b/src/addrman_impl.h
index f8191d6b85..2d01881f2e 100644
--- a/src/addrman_impl.h
+++ b/src/addrman_impl.h
@@ -244,7 +244,9 @@ private:
void Good_(const CService& addr, bool test_before_evict, int64_t time) EXCLUSIVE_LOCKS_REQUIRED(cs);
- bool Add_(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
+ /** Attempt to add a single address to addrman's new table.
+ * @see AddrMan::Add() for parameters. */
+ bool AddSingle(const CAddress& addr, const CNetAddr& source, int64_t nTimePenalty) EXCLUSIVE_LOCKS_REQUIRED(cs);
void Attempt_(const CService& addr, bool fCountFailure, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);