mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02: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:
parent
4885d6f197
commit
80f39c99ef
7 changed files with 45 additions and 61 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue