diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 8ef79cd719..f5cff6297d 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3838,7 +3838,7 @@ public: bool PeerLogicValidation::SendMessages(CNode* pto) { const Consensus::Params& consensusParams = Params().GetConsensus(); - { + // Don't send anything until the version handshake is complete if (!pto->fSuccessfullyConnected || pto->fDisconnect) return true; @@ -3875,9 +3875,8 @@ bool PeerLogicValidation::SendMessages(CNode* pto) } } - TRY_LOCK(cs_main, lockMain); - if (!lockMain) - return true; + { + LOCK(cs_main); if (MaybeDiscourageAndDisconnect(*pto)) return true; @@ -4416,7 +4415,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto) pto->m_tx_relay->nextSendTimeFeeFilter = timeNow + GetRandInt(MAX_FEEFILTER_CHANGE_DELAY) * 1000000; } } - } + } // release cs_main return true; }