aboutsummaryrefslogtreecommitdiff
path: root/src/bench/addrman.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2021-08-05 14:08:48 +0100
committerJohn Newbery <john@johnnewbery.com>2021-08-19 11:26:53 +0100
commit406be5ff9699874dc1d38d11f036e33cbdb820c9 (patch)
tree4637e90a588ec23dcff5d539ecef3319dcb25eaa /src/bench/addrman.cpp
parented9ba8af08f857bda3ce2f77413317374c22d7b4 (diff)
downloadbitcoin-406be5ff9699874dc1d38d11f036e33cbdb820c9.tar.xz
[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.
Diffstat (limited to 'src/bench/addrman.cpp')
-rw-r--r--src/bench/addrman.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/bench/addrman.cpp b/src/bench/addrman.cpp
index 5ae2dafd5a..d69a651811 100644
--- a/src/bench/addrman.cpp
+++ b/src/bench/addrman.cpp
@@ -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();
});
}