From c707ca872dcce98892431d33c250372da714f15f Mon Sep 17 00:00:00 2001 From: Greg Griffith Date: Sun, 7 May 2017 00:42:04 -0400 Subject: [PATCH] removed unused code in INV message vToFetch is never used after declaration. When checked if not empty, evaluation is always false. Best case scenario this is optimized by the compiler, worst case it wastes cpu cycles. It should be removed either way. --- src/net_processing.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index debab436f6b..22a8e570efe 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1552,8 +1552,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr uint32_t nFetchFlags = GetFetchFlags(pfrom); - std::vector vToFetch; - for (unsigned int nInv = 0; nInv < vInv.size(); nInv++) { CInv &inv = vInv[nInv]; @@ -1593,9 +1591,6 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr // Track requests for our stuff GetMainSignals().Inventory(inv.hash); } - - if (!vToFetch.empty()) - connman.PushMessage(pfrom, msgMaker.Make(NetMsgType::GETDATA, vToFetch)); }