mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
llmq: Avoid endless loop in GetQuorumRelayMembers (#4796)
* llmq: Avoid endless loop in GetQuorumRelayMembers regtest quorums can be tiny * minimize changes, add a note
This commit is contained in:
parent
cb75351543
commit
b8c9eec34f
@ -588,6 +588,12 @@ std::set<uint256> CLLMQUtils::GetQuorumRelayMembers(const Consensus::LLMQParams&
|
|||||||
std::set<uint256> result;
|
std::set<uint256> result;
|
||||||
|
|
||||||
auto calcOutbound = [&](size_t i, const uint256& proTxHash) {
|
auto calcOutbound = [&](size_t i, const uint256& proTxHash) {
|
||||||
|
if (mns.size() == 1) {
|
||||||
|
// No outbound connections are needed when there is one MN only.
|
||||||
|
// Also note that trying to calculate results via the algorithm below
|
||||||
|
// would result in an endless loop.
|
||||||
|
return std::set<uint256>();
|
||||||
|
}
|
||||||
// Relay to nodes at indexes (i+2^k)%n, where
|
// Relay to nodes at indexes (i+2^k)%n, where
|
||||||
// k: 0..max(1, floor(log2(n-1))-1)
|
// k: 0..max(1, floor(log2(n-1))-1)
|
||||||
// n: size of the quorum/ring
|
// n: size of the quorum/ring
|
||||||
|
Loading…
Reference in New Issue
Block a user