mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-01 08:44:02 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user