[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

@@ -72,11 +72,9 @@ static void AddrManAdd(benchmark::Bench& bench)
{
CreateAddresses();
CAddrMan addrman(/* deterministic */ false, /* consistency_check_ratio */ 0);
bench.run([&] {
CAddrMan addrman{/* deterministic */ false, /* consistency_check_ratio */ 0};
AddAddressesToAddrMan(addrman);
addrman.Clear();
});
}