From e008afdb3c5dbeb7aaff8ed13b84520a159b38fc Mon Sep 17 00:00:00 2001 From: glozow Date: Mon, 19 Aug 2024 10:58:20 +0100 Subject: [PATCH] [unit test] orphan dos --- src/test/fuzz/txdownloadman.cpp | 1 - src/test/orphanage_tests.cpp | 116 +++++++++++++++++++++++++++++++- 2 files changed, 115 insertions(+), 2 deletions(-) diff --git a/src/test/fuzz/txdownloadman.cpp b/src/test/fuzz/txdownloadman.cpp index 24ec00cc12762d..b3ac1af8e59c9f 100644 --- a/src/test/fuzz/txdownloadman.cpp +++ b/src/test/fuzz/txdownloadman.cpp @@ -259,7 +259,6 @@ static void CheckInvariants(const node::TxDownloadImpl& txdownload_impl, size_t // We should never have more than the maximum in-flight requests out for a peer. Assert(txdownload_impl.m_txrequest.CountInFlight(peer) <= node::MAX_PEER_TX_REQUEST_IN_FLIGHT); Assert(txdownload_impl.m_orphan_resolution_tracker.Count(peer) <= node::MAX_ORPHAN_RESOLUTIONS); - Assert(txdownload_impl.m_orphanage.BytesFromPeer(peer) <= node::MAX_ORPHAN_BYTES_PREFERRED); } } } diff --git a/src/test/orphanage_tests.cpp b/src/test/orphanage_tests.cpp index 6fb0ff96ee3352..ebe6069f331ec2 100644 --- a/src/test/orphanage_tests.cpp +++ b/src/test/orphanage_tests.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include