From b4b657ba57a2ce31b3c21ea9245aad26d5b06a57 Mon Sep 17 00:00:00 2001 From: chinggg <24590067+chinggg@users.noreply.github.com> Date: Sat, 23 Jul 2022 20:51:07 +0800 Subject: refactor: log `nEvicted` message in `LimitOrphans` then return void `LimitOrphans()` can log expired tx and it should log evicted tx as well instead of returning the number for caller to print the message. Since `LimitOrphans()` now return void, the redundant assertion check in fuzz test is also removed. --- src/test/fuzz/txorphan.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/fuzz/txorphan.cpp b/src/test/fuzz/txorphan.cpp index cc20f89bbf..9278f03423 100644 --- a/src/test/fuzz/txorphan.cpp +++ b/src/test/fuzz/txorphan.cpp @@ -138,10 +138,8 @@ FUZZ_TARGET_INIT(txorphan, initialize_orphanage) [&] { // test mocktime and expiry SetMockTime(ConsumeTime(fuzzed_data_provider)); - auto size_before = orphanage.Size(); auto limit = fuzzed_data_provider.ConsumeIntegral(); - auto n_evicted = WITH_LOCK(g_cs_orphans, return orphanage.LimitOrphans(limit)); - Assert(size_before - n_evicted <= limit); + WITH_LOCK(g_cs_orphans, orphanage.LimitOrphans(limit)); Assert(orphanage.Size() <= limit); }); } -- cgit v1.2.3