diff options
author | chinggg <24590067+chinggg@users.noreply.github.com> | 2022-07-23 20:51:07 +0800 |
---|---|---|
committer | chinggg <24590067+chinggg@users.noreply.github.com> | 2022-07-28 14:39:45 +0800 |
commit | b4b657ba57a2ce31b3c21ea9245aad26d5b06a57 (patch) | |
tree | 8fb1b9db0e88fda2087ed13b34450ac22bce6565 /src/test/fuzz | |
parent | 194f6dc43ccc330a8a4607be3a2b8935490d6db0 (diff) | |
download | bitcoin-b4b657ba57a2ce31b3c21ea9245aad26d5b06a57.tar.xz |
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.
Diffstat (limited to 'src/test/fuzz')
-rw-r--r-- | src/test/fuzz/txorphan.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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<unsigned int>(); - 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); }); } |