From 7f916e470215523ebe4c5ee3fa3b8942c0bbcc6d Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 11 Aug 2015 09:00:46 +0300 Subject: [PATCH] manage DS connections to masternodes properly --- src/masternodeman.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index c9e3937f21..60273c7ab8 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -634,11 +634,10 @@ void CMasternodeMan::ProcessMasternodeConnections() //we don't care about this for regtest if(Params().NetworkID() == CBaseChainParams::REGTEST) return; - if(!darkSendPool.pSubmittedToMasternode) return; - - CNode* pnode = FindNode(darkSendPool.pSubmittedToMasternode->addr); - if(pnode != NULL) { + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) { if(pnode->fDarkSendMaster){ + if(darkSendPool.pSubmittedToMasternode != NULL && pnode->addr == darkSendPool.pSubmittedToMasternode->addr) continue; LogPrintf("Closing Masternode connection %s \n", pnode->addr.ToString()); pnode->fDisconnect = true; }