13 #include "validation.h"
24 hw << static_cast<uint8_t>(llmqType);
35 h << static_cast<uint8_t>(llmqType);
42 std::string
ToHexStr(
const std::vector<bool>& vBits)
44 std::vector<uint8_t> vBytes((vBits.size() + 7) / 8);
45 for (
size_t i = 0; i < vBits.size(); i++) {
46 vBytes[i / 8] |= vBits[i] << (i % 8);
59 auto quorums =
quorumManager->ScanQuorums(llmqType, (
int)params.signingActiveQuorumCount + 1);
60 for (
auto& q : quorums) {
61 if (q->pindexQuorum->GetBlockHash() == quorumHash) {
68 template <
typename CacheType>
71 for (
auto&
llmq :
Params().GetConsensus().llmqs) {
72 cache.emplace(std::piecewise_construct, std::forward_as_tuple(
llmq.first),
73 std::forward_as_tuple(
llmq.second.signingActiveQuorumCount + 1));
77 template void InitQuorumsCache<std::map<Consensus::LLMQType, unordered_lru_cache<uint256, bool, StaticSaltedHasher>>>(std::map<Consensus::LLMQType, unordered_lru_cache<uint256, bool, StaticSaltedHasher>>& cache);
78 template void InitQuorumsCache<std::map<Consensus::LLMQType, unordered_lru_cache<uint256, std::vector<CQuorumCPtr>,
StaticSaltedHasher>>>(std::map<Consensus::LLMQType, unordered_lru_cache<uint256, std::vector<CQuorumCPtr>,
StaticSaltedHasher>>& cache);
79 template void InitQuorumsCache<std::map<Consensus::LLMQType, unordered_lru_cache<uint256, CQuorumCPtr, StaticSaltedHasher>>>(std::map<Consensus::LLMQType, unordered_lru_cache<uint256, CQuorumCPtr, StaticSaltedHasher>>& cache);
const CChainParams & Params()
Return the currently selected parameters.
const Consensus::Params & GetConsensus() const
A writer stream (for serialization) that computes a 256-bit hash.
std::string ToHexStr(const std::vector< bool > &vBits)
uint256 BuildSignHash(Consensus::LLMQType llmqType, const uint256 &quorumHash, const uint256 &id, const uint256 &msgHash)
bool IsQuorumActive(Consensus::LLMQType llmqType, const uint256 &quorumHash)
void InitQuorumsCache(CacheType &cache)
uint256 BuildCommitmentHash(Consensus::LLMQType llmqType, const uint256 &blockHash, const std::vector< bool > &validMembers, const CBLSPublicKey &pubKey, const uint256 &vvecHash)
std::unique_ptr< CQuorumManager > quorumManager
std::map< LLMQType, LLMQParams > llmqs
std::string HexStr(const Span< const uint8_t > s)
Convert a span of bytes to a lower-case hexadecimal string.