From 6eb5410d8f746da03a50eb964795c16cce916eb7 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 9 Sep 2014 09:26:52 +0200 Subject: [PATCH] Avoid returning many "inv" orphans Rebased-From: 540ac45 Rebased-By: Wladimir J. van der Laan --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 07b20906f54..30971e9978c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3606,6 +3606,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) // Track requests for our stuff g_signals.Inventory(inv.hash); + + if (pfrom->nSendSize > (SendBufferSize() * 2)) { + Misbehaving(pfrom->GetId(), 50); + return error("send buffer size() = %u", pfrom->nSendSize); + } } }