mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Make EnsureQuorumConnections re-set connections in every iteration
Instead of only doing it the first time. This is a preparation for the new intra-quorum connection system (which connects all members to all other members)
This commit is contained in:
parent
9ef1e7cb51
commit
7f1f1d12f5
@ -193,9 +193,8 @@ void CQuorumManager::EnsureQuorumConnections(Consensus::LLMQType llmqType, const
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!g_connman->HasMasternodeQuorumNodes(llmqType, quorum->qc.quorumHash)) {
|
||||
CLLMQUtils::EnsureQuorumConnections(llmqType, quorum->pindexQuorum, myProTxHash, allowWatch);
|
||||
}
|
||||
|
||||
connmanQuorumsToDelete.erase(quorum->qc.quorumHash);
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ void CLLMQUtils::EnsureQuorumConnections(Consensus::LLMQType llmqType, const CBl
|
||||
}
|
||||
LogPrint(BCLog::LLMQ, debugMsg.c_str());
|
||||
}
|
||||
g_connman->AddMasternodeQuorumNodes(llmqType, pindexQuorum->GetBlockHash(), connections);
|
||||
g_connman->SetMasternodeQuorumNodes(llmqType, pindexQuorum->GetBlockHash(), connections);
|
||||
}
|
||||
}
|
||||
|
||||
|
10
src/net.cpp
10
src/net.cpp
@ -2797,15 +2797,13 @@ bool CConnman::AddPendingMasternode(const uint256& proTxHash)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CConnman::AddMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes)
|
||||
void CConnman::SetMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes)
|
||||
{
|
||||
LOCK(cs_vPendingMasternodes);
|
||||
auto it = masternodeQuorumNodes.find(std::make_pair(llmqType, quorumHash));
|
||||
if (it != masternodeQuorumNodes.end()) {
|
||||
return false;
|
||||
auto it = masternodeQuorumNodes.emplace(std::make_pair(llmqType, quorumHash), proTxHashes);
|
||||
if (!it.second) {
|
||||
it.first->second = proTxHashes;
|
||||
}
|
||||
masternodeQuorumNodes.emplace(std::make_pair(llmqType, quorumHash), proTxHashes);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CConnman::HasMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash)
|
||||
|
@ -408,7 +408,7 @@ public:
|
||||
std::vector<AddedNodeInfo> GetAddedNodeInfo();
|
||||
|
||||
bool AddPendingMasternode(const uint256& proTxHash);
|
||||
bool AddMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes);
|
||||
void SetMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash, const std::set<uint256>& proTxHashes);
|
||||
bool HasMasternodeQuorumNodes(Consensus::LLMQType llmqType, const uint256& quorumHash);
|
||||
std::set<uint256> GetMasternodeQuorums(Consensus::LLMQType llmqType);
|
||||
// also returns QWATCH nodes
|
||||
|
Loading…
Reference in New Issue
Block a user