From 8c02b591e92d80749f55e45290fe5d9eea37aa2d Mon Sep 17 00:00:00 2001 From: furszy Date: Thu, 11 Nov 2021 20:17:29 -0300 Subject: [PATCH] net: simplify fRelayTxes flag processing --- src/net_processing.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 48e518696567c..887126e98f916 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -1115,6 +1115,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR std::string strSubVer; std::string cleanSubVer; int nStartingHeight = -1; + bool fRelay = true; vRecv >> nVersion >> nServiceInt >> nTime >> addrMe; nSendVersion = std::min(nVersion, PROTOCOL_VERSION); nServices = ServiceFlags(nServiceInt); @@ -1142,6 +1143,9 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR if (!vRecv.empty()) { vRecv >> nStartingHeight; } + if (!vRecv.empty()) { + vRecv >> fRelay; + } // Disconnect if we connected to ourself if (pfrom->fInbound && !connman->CheckIncomingNonce(nNonce)) { @@ -1183,11 +1187,7 @@ bool static ProcessMessage(CNode* pfrom, std::string strCommand, CDataStream& vR { LOCK(pfrom->cs_filter); - if (!vRecv.empty()) { - vRecv >> pfrom->fRelayTxes; // set to true after we get the first filter* message - } else { - pfrom->fRelayTxes = true; - } + pfrom->fRelayTxes = fRelay; // set to true after we get the first filter* message } // Change version