diff options
author | John Newbery <john@johnnewbery.com> | 2021-08-05 14:08:48 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2021-08-19 11:26:53 +0100 |
commit | 406be5ff9699874dc1d38d11f036e33cbdb820c9 (patch) | |
tree | 4637e90a588ec23dcff5d539ecef3319dcb25eaa /src/bench | |
parent | ed9ba8af08f857bda3ce2f77413317374c22d7b4 (diff) | |
download | bitcoin-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')
-rw-r--r-- | src/bench/addrman.cpp | 4 |
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(); }); } |