neobytes/src/llmq/quorums_utils.h
2019-01-09 12:16:12 +01:00

32 lines
1.0 KiB
C++

// 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);
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);
};
}
#endif//DASH_QUORUMS_UTILS_H