fix(llmq): Actually remove old masternode quorum connections (#4859)

This commit is contained in:
UdjinM6 2022-06-08 00:06:40 +03:00 committed by pasta
parent 9f27648dc2
commit 21bf0eacdb
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -291,13 +291,15 @@ void CQuorumManager::EnsureQuorumConnections(const Consensus::LLMQParams& llmqPa
for (const auto& quorum : lastQuorums) {
if (CLLMQUtils::EnsureQuorumConnections(llmqParams, quorum->m_quorum_base_block_index, WITH_LOCK(activeMasternodeInfoCs, return activeMasternodeInfo.proTxHash))) {
continue;
if (connmanQuorumsToDelete.erase(quorum->qc->quorumHash) > 0) {
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- llmqType[%d] h[%d] keeping mn quorum connections for quorum: [%d:%s]\n", __func__, int(llmqParams.type), pindexNew->nHeight, quorum->m_quorum_base_block_index->nHeight, quorum->m_quorum_base_block_index->GetBlockHash().ToString());
}
if (connmanQuorumsToDelete.count(quorum->qc->quorumHash) > 0) {
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- removing masternodes quorum connections for quorum %s:\n", __func__, quorum->qc->quorumHash.ToString());
g_connman->RemoveMasternodeQuorumNodes(llmqParams.type, quorum->qc->quorumHash);
}
}
for (const auto& quorumHash : connmanQuorumsToDelete) {
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- removing masternodes quorum connections for quorum %s:\n", __func__, quorumHash.ToString());
g_connman->RemoveMasternodeQuorumNodes(llmqParams.type, quorumHash);
}
}
CQuorumPtr CQuorumManager::BuildQuorumFromCommitment(const Consensus::LLMQType llmqType, const CBlockIndex* pQuorumBaseBlockIndex) const