2018-11-23 15:42:09 +01:00
|
|
|
// Copyright (c) 2018 The Dash Core developers
|
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef DASH_QUORUMS_UTILS_H
|
|
|
|
#define DASH_QUORUMS_UTILS_H
|
|
|
|
|
|
|
|
#include "consensus/params.h"
|
|
|
|
|
|
|
|
#include "evo/deterministicmns.h"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llmq
|
|
|
|
{
|
|
|
|
|
|
|
|
class CLLMQUtils
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// includes members which failed DKG
|
|
|
|
static std::vector<CDeterministicMNCPtr> GetAllQuorumMembers(Consensus::LLMQType llmqType, const uint256& blockHash);
|
|
|
|
|
|
|
|
static uint256 BuildCommitmentHash(uint8_t llmqType, const uint256& blockHash, const std::vector<bool>& validMembers, const CBLSPublicKey& pubKey, const uint256& vvecHash);
|
2018-05-24 16:14:55 +02:00
|
|
|
|
|
|
|
static std::set<CService> GetQuorumConnections(Consensus::LLMQType llmqType, const uint256& blockHash, const uint256& forMember);
|
|
|
|
static std::set<size_t> CalcDeterministicWatchConnections(Consensus::LLMQType llmqType, const uint256& blockHash, size_t memberCount, size_t connectionCount);
|
2018-11-23 15:42:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif//DASH_QUORUMS_UTILS_H
|