Skip to content

Commit

Permalink
refactor: combine two if blocks
Browse files Browse the repository at this point in the history
Co-authored-by: UdjinM6 <[email protected]>
  • Loading branch information
PastaPastaPasta and UdjinM6 committed Jul 31, 2024
1 parent 352b77f commit 5526ab9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5184,8 +5184,7 @@ void PeerManagerImpl::EvictExtraOutboundPeers(std::chrono::seconds now)
size_t onion_count = 0;
m_connman.ForEachNode([&](CNode* pnode) {
LockAssertion lock(::cs_main);
if (pnode->addr.IsTor()) onion_count++;
if (pnode->addr.IsTor() && onion_count <= m_connman.GetMaxOutboundOnionNodeCount()) return;
if (pnode->addr.IsTor() && ++onion_count <= m_connman.GetMaxOutboundOnionNodeCount()) return;
// Don't disconnect masternodes just because they were slow in block announcement
if (pnode->m_masternode_connection) return;
// Only consider outbound-full-relay peers that are not already
Expand Down

0 comments on commit 5526ab9

Please sign in to comment.