Skip to content

Commit

Permalink
19316-2
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydasmp committed Jul 29, 2023
1 parent c8c645c commit 6c3deb3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ int CGovernanceManager::RequestGovernanceObjectVotes(Span<CNode*> vNodesCopy, CC
// Don't try to sync any data from outbound non-relay "masternode" connections.
// Inbound connection this early is most likely a "masternode" connection
// initiated from another node, so skip it too.
if (!pnode->CanRelay() || (fMasternodeMode && pnode->fInbound)) continue;
if (!pnode->CanRelay() || (fMasternodeMode && pnode->IsInboundConn())) continue;
// stop early to prevent setAskFor overflow
{
LOCK(cs_main);
Expand Down
4 changes: 2 additions & 2 deletions src/masternode/sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ void CMasternodeSync::ProcessTick()
// Don't try to sync any data from outbound non-relay "masternode" connections.
// Inbound connection this early is most likely a "masternode" connection
// initiated from another node, so skip it too.
if (!pnode->CanRelay() || (fMasternodeMode && pnode->fInbound)) continue;
if (!pnode->CanRelay() || (fMasternodeMode && pnode->IsInboundConn())) continue;

{
if ((pnode->HasPermission(PF_NOBAN) || pnode->m_manual_connection) && !netfulfilledman.HasFulfilledRequest(pnode->addr, strAllow)) {
Expand Down Expand Up @@ -201,7 +201,7 @@ void CMasternodeSync::ProcessTick()
// Now that the blockchain is synced request the mempool from the connected outbound nodes if possible
for (auto pNodeTmp : vNodesCopy) {
bool fRequestedEarlier = netfulfilledman.HasFulfilledRequest(pNodeTmp->addr, "mempool-sync");
if (pNodeTmp->nVersion >= 70216 && !pNodeTmp->fInbound && !fRequestedEarlier && !pNodeTmp->IsBlockRelayOnly()) {
if (pNodeTmp->nVersion >= 70216 && !pNodeTmp->IsInboundConn() && !fRequestedEarlier && !pNodeTmp->IsBlockRelayOnly()) {
netfulfilledman.AddFulfilledRequest(pNodeTmp->addr, "mempool-sync");
connman.PushMessage(pNodeTmp, msgMaker.Make(NetMsgType::MEMPOOL));
LogPrint(BCLog::MNSYNC, "CMasternodeSync::ProcessTick -- nTick %d nCurrentAsset %d -- syncing mempool from peer=%d\n", nTick, nCurrentAsset, pNodeTmp->GetId());
Expand Down
4 changes: 2 additions & 2 deletions src/masternode/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void CMasternodeUtils::DoMaintenance(CConnman& connman, const CMasternodeSync& m
// Don't disconnect masternode connections when we have less then the desired amount of outbound nodes
int nonMasternodeCount = 0;
connman.ForEachNode(CConnman::AllNodes, [&](CNode* pnode) {
if ((!pnode->fInbound &&
if ((!pnode->IsInboundConn() &&
!pnode->fFeeler &&
!pnode->m_manual_connection &&
!pnode->m_masternode_connection &&
Expand Down Expand Up @@ -58,7 +58,7 @@ void CMasternodeUtils::DoMaintenance(CConnman& connman, const CMasternodeSync& m
return;
}
// keep _verified_ inbound connections
if (pnode->fInbound) {
if (pnode->IsInboundConn()) {
return;
}
} else if (GetSystemTimeInSeconds() - pnode->nTimeConnected < 5) {
Expand Down

0 comments on commit 6c3deb3

Please sign in to comment.