From fc5b0f38bdf2b58ad635b71c9b3a16750d16ec00 Mon Sep 17 00:00:00 2001 From: Duke Date: Mon, 16 Sep 2024 11:17:56 -0400 Subject: [PATCH] Revert "Memory DoS fixes" This reverts commit 6a5f0eafde1d055dec2124e7564180cdaa9c7194. --- src/main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 4c059cf88..4a9de15a7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7319,8 +7319,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return error("message inv size() = %u", vInv.size()); } - bool fBlocksOnly = GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY); - LOCK(cs_main); const uint256* best_block{nullptr}; @@ -7351,10 +7349,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, best_block = &inv.hash; } } else { - pfrom->AddInventoryKnown(inv); + pfrom->AddKnownWTxId(WTxId(inv.hash, inv.hashAux)); if (fBlocksOnly) LogPrint("net", "transaction (%s) inv sent in violation of protocol peer=%d\n", inv.hash.ToString(), pfrom->id); - else if (!fAlreadyHave && !IsInitialBlockDownload()) + else if (!fAlreadyHave && !IsInitialBlockDownload(chainparams.GetConsensus())) pfrom->AskFor(inv); } if (pfrom->nSendSize > (SendBufferSize() * 2)) {