[addrman] Remove all public uses of CAddrMan.Clear() from the tests

Just use unique_ptr<CAddrMan>s and reset the pointer if a frest addrman is required.
Also make CAddrMan::Clear() private to ensure that no call sites are missed.
This commit is contained in:
John Newbery
2021-08-05 14:08:48 +01:00
parent ed9ba8af08
commit 406be5ff96
4 changed files with 56 additions and 73 deletions

View File

@@ -471,6 +471,7 @@ public:
Check();
}
private:
void Clear()
EXCLUSIVE_LOCKS_REQUIRED(!cs)
{
@@ -496,6 +497,7 @@ public:
mapAddr.clear();
}
public:
explicit CAddrMan(bool deterministic, int32_t consistency_check_ratio)
: insecure_rand{deterministic},
m_consistency_check_ratio{consistency_check_ratio}