fix: Handle quorum watch connections correctly (#4933)

We add them via EnsureQuorumConnections+ThreadOpenMasternodeConnections so they are clearly masternode connections and they are dropped regularly which is annoying. But also, we don't want every masternode connection to be a qwatch one, we want only the ones we added via that algo.
This commit is contained in:
UdjinM6 2022-07-26 00:35:45 +03:00 committed by pasta
parent 0ca9fc087c
commit f7427d9c13
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984
2 changed files with 4 additions and 1 deletions

View File

@ -61,6 +61,9 @@ void CMasternodeUtils::ProcessMasternodeConnections(CConnman& connman)
} else if (GetSystemTimeInSeconds() - pnode->nTimeConnected < 5) {
// non-verified, give it some time to verify itself
return;
} else if (pnode->qwatch) {
// keep watching nodes
return;
}
// we're not disconnecting masternode probes for at least a few seconds
if (pnode->m_masternode_probe_connection && GetSystemTimeInSeconds() - pnode->nTimeConnected < 5) return;

View File

@ -2716,7 +2716,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& msg_type, CDataStrea
// Tell our peer that he should send us CoinJoin queue messages
connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::SENDDSQUEUE, true));
if (llmq::CLLMQUtils::IsWatchQuorumsEnabled() && !pfrom->m_masternode_connection) {
if (llmq::CLLMQUtils::IsWatchQuorumsEnabled() && connman->IsMasternodeQuorumNode(pfrom)) {
connman->PushMessage(pfrom, msgMaker.Make(NetMsgType::QWATCH));
}