From 5dc94d13d419b8d5e543cb50edeb872335c090e7 Mon Sep 17 00:00:00 2001 From: glozow Date: Wed, 6 Nov 2024 09:29:07 -0300 Subject: [PATCH] fuzz fix: assert MAX_PEER_TX_ANNOUNCEMENTS is not exceeded Previously this assertion checked MAX_PEER_TX_REQUEST_IN_FLIGHT was not exceeded. However, this property is not actually enforced; it is just used to determine when a peer is overloaded. --- src/test/fuzz/txdownloadman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/fuzz/txdownloadman.cpp b/src/test/fuzz/txdownloadman.cpp index 90e04d8376f97..a313caa1117e7 100644 --- a/src/test/fuzz/txdownloadman.cpp +++ b/src/test/fuzz/txdownloadman.cpp @@ -287,7 +287,7 @@ static void CheckInvariants(const node::TxDownloadManagerImpl& txdownload_impl, // We should never have more than the maximum in-flight requests out for a peer. for (NodeId peer = 0; peer < NUM_PEERS; ++peer) { if (!HasRelayPermissions(peer)) { - Assert(txdownload_impl.m_txrequest.CountInFlight(peer) <= node::MAX_PEER_TX_REQUEST_IN_FLIGHT); + Assert(txdownload_impl.m_txrequest.Count(peer) <= node::MAX_PEER_TX_ANNOUNCEMENTS); } } txdownload_impl.m_txrequest.SanityCheck();