mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
addrman, refactor: combine two size functions
The functionality of the old size() is covered by the new Size() when no arguments are specified, so this does not change behavior. Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
This commit is contained in:
committed by
Martin Zumsande
parent
4885d6f197
commit
80f39c99ef
@@ -1112,12 +1112,6 @@ int AddrManImpl::CheckAddrman() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t AddrManImpl::size() const
|
||||
{
|
||||
LOCK(cs); // TODO: Cache this in an atomic to avoid this overhead
|
||||
return vRandom.size();
|
||||
}
|
||||
|
||||
size_t AddrManImpl::Size(std::optional<Network> net, std::optional<bool> in_new) const
|
||||
{
|
||||
LOCK(cs);
|
||||
@@ -1239,11 +1233,6 @@ template void AddrMan::Unserialize(CHashVerifier<CAutoFile>& s);
|
||||
template void AddrMan::Unserialize(CDataStream& s);
|
||||
template void AddrMan::Unserialize(CHashVerifier<CDataStream>& s);
|
||||
|
||||
size_t AddrMan::size() const
|
||||
{
|
||||
return m_impl->size();
|
||||
}
|
||||
|
||||
size_t AddrMan::Size(std::optional<Network> net, std::optional<bool> in_new) const
|
||||
{
|
||||
return m_impl->Size(net, in_new);
|
||||
|
||||
Reference in New Issue
Block a user