From 376f78d8aac121f5fcae976bbd7fefbe75d5dbe8 Mon Sep 17 00:00:00 2001 From: PastaPastaPasta <6443210+PastaPastaPasta@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:24:16 -0500 Subject: [PATCH] format: fix indentation (#5277) ## Issue being fixed or feature implemented Indentation was wrong ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation **For repository code-owners and collaborators only** - [x] I have assigned this pull request to a milestone --- src/net.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index 1dd7e4495f..51bf6c3c0f 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2534,31 +2534,31 @@ void CConnman::ThreadOpenMasternodeConnections() } const auto& addr2 = dmn->pdmnState->addr; if (connectedNodes.count(addr2) && !connectedProRegTxHashes.count(proRegTxHash)) { - // we probably connected to it before it became a masternode - // or maybe we are still waiting for mnauth - (void)ForNode(addr2, [&](CNode* pnode) { - if (pnode->nTimeFirstMessageReceived != 0 && GetSystemTimeInSeconds() - pnode->nTimeFirstMessageReceived > 5) { - // clearly not expecting mnauth to take that long even if it wasn't the first message - // we received (as it should normally), disconnect - LogPrint(BCLog::NET_NETCONN, "CConnman::%s -- dropping non-mnauth connection to %s, service=%s\n", _func_, proRegTxHash.ToString(), addr2.ToString(false)); - pnode->fDisconnect = true; - return true; - } - return false; - }); - // either way - it's not ready, skip it for now + // we probably connected to it before it became a masternode + // or maybe we are still waiting for mnauth + (void)ForNode(addr2, [&](CNode* pnode) { + if (pnode->nTimeFirstMessageReceived != 0 && GetSystemTimeInSeconds() - pnode->nTimeFirstMessageReceived > 5) { + // clearly not expecting mnauth to take that long even if it wasn't the first message + // we received (as it should normally), disconnect + LogPrint(BCLog::NET_NETCONN, "CConnman::%s -- dropping non-mnauth connection to %s, service=%s\n", _func_, proRegTxHash.ToString(), addr2.ToString(false)); + pnode->fDisconnect = true; + return true; + } + return false; + }); + // either way - it's not ready, skip it for now + continue; + } + if (!connectedNodes.count(addr2) && !IsMasternodeOrDisconnectRequested(addr2) && !connectedProRegTxHashes.count(proRegTxHash)) { + int64_t lastAttempt = mmetaman.GetMetaInfo(dmn->proTxHash)->GetLastOutboundAttempt(); + // back off trying connecting to an address if we already tried recently + if (nANow - lastAttempt < chainParams.LLMQConnectionRetryTimeout()) { continue; } - if (!connectedNodes.count(addr2) && !IsMasternodeOrDisconnectRequested(addr2) && !connectedProRegTxHashes.count(proRegTxHash)) { - int64_t lastAttempt = mmetaman.GetMetaInfo(dmn->proTxHash)->GetLastOutboundAttempt(); - // back off trying connecting to an address if we already tried recently - if (nANow - lastAttempt < chainParams.LLMQConnectionRetryTimeout()) { - continue; - } - ret.emplace_back(dmn); - } + ret.emplace_back(dmn); } } + } return ret; };