Skip to content

Commit

Permalink
fix: Do this only for masternodes which participate in IS quorums
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Jul 14, 2022
1 parent 98a486c commit 8940da7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/llmq/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,26 @@ bool CLLMQUtils::EnsureQuorumConnections(const Consensus::LLMQParams& llmqParams

bool isMember = ranges::find_if(members, [&](const auto& dmn) { return dmn->proTxHash == myProTxHash; }) != members.end();

bool isISType = llmqParams.type == Params().GetConsensus().llmqTypeInstantSend ||
llmqParams.type == Params().GetConsensus().llmqTypeDIP0024InstantSend;

bool isOldMember{false};
if (isISType && !myProTxHash.IsNull()) {
auto quorums = llmq::quorumManager->ScanQuorums(llmqParams.type, llmqParams.keepOldConnections);
for (auto& quorum : quorums) {
if (quorum->IsMember(myProTxHash)) {
isOldMember = true;
break;
}
}
}

if (!isMember && !isOldMember && !CLLMQUtils::IsWatchQuorumsEnabled()) {
return false;
}
LogPrint(BCLog::NET_NETCONN, "CLLMQUtils::%s -- isMember=%d isOldMember=%d for quorum %s:\n",
__func__, isMember, isOldMember, pQuorumBaseBlockIndex->GetBlockHash().ToString());

std::set<uint256> connections;
std::set<uint256> relayMembers;
if (isMember) {
Expand Down

0 comments on commit 8940da7

Please sign in to comment.