mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
[addrman] Merge the two Add() functions
Merge the two definitions of this overloaded function to reduce code duplication.
This commit is contained in:
@@ -517,22 +517,7 @@ public:
|
||||
return vRandom.size();
|
||||
}
|
||||
|
||||
//! Add a single address.
|
||||
bool Add(const CAddress &addr, const CNetAddr& source, int64_t nTimePenalty = 0)
|
||||
EXCLUSIVE_LOCKS_REQUIRED(!cs)
|
||||
{
|
||||
LOCK(cs);
|
||||
bool fRet = false;
|
||||
Check();
|
||||
fRet |= Add_(addr, source, nTimePenalty);
|
||||
Check();
|
||||
if (fRet) {
|
||||
LogPrint(BCLog::ADDRMAN, "Added %s from %s: %i tried, %i new\n", addr.ToStringIPPort(), source.ToString(), nTried, nNew);
|
||||
}
|
||||
return fRet;
|
||||
}
|
||||
|
||||
//! Add multiple addresses.
|
||||
//! Add addresses to addrman's new table.
|
||||
bool Add(const std::vector<CAddress> &vAddr, const CNetAddr& source, int64_t nTimePenalty = 0)
|
||||
EXCLUSIVE_LOCKS_REQUIRED(!cs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user