Skip to content

Commit

Permalink
Conflict fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jan 17, 2022
1 parent e75d136 commit 2a470a4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/llmq/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,17 +631,17 @@ std::vector<const CBlockIndex*> CQuorumBlockProcessor::GetMinedCommitmentsIndexe
std::map<Consensus::LLMQType, std::vector<const CBlockIndex*>> CQuorumBlockProcessor::GetMinedAndActiveCommitmentsUntilBlock(const CBlockIndex* pindex) const
{
std::map<Consensus::LLMQType, std::vector<const CBlockIndex*>> ret;

for (const auto& p : Params().GetConsensus().llmqs) {
auto& v = ret[p.second.type];
v.reserve(p.second.signingActiveQuorumCount);
if (CLLMQUtils::IsQuorumRotationEnabled(p.second.type)) {
std::vector<std::pair<int, const CBlockIndex*>> commitments = GetLastMinedCommitmentsPerQuorumIndexUntilBlock(p.second.type, pindex, 0);
auto& v = ret[p.type];
v.reserve(p.signingActiveQuorumCount);
if (CLLMQUtils::IsQuorumRotationEnabled(p.type)) {
std::vector<std::pair<int, const CBlockIndex*>> commitments = GetLastMinedCommitmentsPerQuorumIndexUntilBlock(p.type, pindex, 0);
std::transform( commitments.begin(), commitments.end(), std::back_inserter( v ),
[](const std::pair<int, const CBlockIndex*>& p) { return p.second; });
}
else {
auto commitments = GetMinedCommitmentsUntilBlock(p.second.type, pindex, p.second.signingActiveQuorumCount);
auto commitments = GetMinedCommitmentsUntilBlock(p.type, pindex, p.signingActiveQuorumCount);
std::copy(commitments.begin(), commitments.end(), std::back_inserter(v));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ UniValue CDKGDebugStatus::ToJson(int detailLevel) const
// TODO Support array of sessions
UniValue sessionsArrJson(UniValue::VARR);
for (const auto& p : sessions) {
if (!Params().GetConsensus().llmqs.count(p.first.first)) {
if (!Params().HasLLMQ(p.first.first)) {
continue;
}
UniValue s(UniValue::VOBJ);
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class CDKGLogger : public CBatchedLogger
{
public:
CDKGLogger(const CDKGSession& _quorumDkg, std::string_view _func) :
CDKGLogger(_quorumDkg.params.name, _quorumDkg.m_quorum_base_block_index->GetBlockHash(), _quorumDkg.m_quorum_base_block_index->nHeight, _quorumDkg.AreWeMember(), _func) {};
CDKGLogger(_quorumDkg.params.name, _quorumDkg.quorumIndex, _quorumDkg.m_quorum_base_block_index->GetBlockHash(), _quorumDkg.m_quorum_base_block_index->nHeight, _quorumDkg.AreWeMember(), _func) {};
CDKGLogger(std::string_view _llmqTypeName, int _quorumIndex, const uint256& _quorumHash, int _height, bool _areWeMember, std::string_view _func) :
CBatchedLogger(BCLog::LLMQ_DKG, strprintf("QuorumDKG(type=%s, quorumIndex=%d, height=%d, member=%d, func=%s)", _llmqTypeName, _quorumIndex, _height, _areWeMember, _func)) {};
};
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsessionmgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CDKGSessionManager::CDKGSessionManager(CBLSWorker& _blsWorker, bool unitTests, b
MigrateDKG();

for (const auto& params : Params().GetConsensus().llmqs) {
for (int i: boost::irange(0, params.signingActiveQuorumCount : 1)) {
for (int i: boost::irange(0, params.signingActiveQuorumCount)) {
dkgSessionHandlers.emplace(std::piecewise_construct,
std::forward_as_tuple(params.type, i),
std::forward_as_tuple(params, blsWorker, *this, i));
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ std::vector<std::vector<CDeterministicMNCPtr>> CLLMQUtils::BuildNewQuorumQuarter
}
}

allMns.ForEachMN(true, [&MnsUsedAtH, &MnsNotUsedAtH](const CDeterministicMNCPtr& dmn){
allMns.ForEachMNShared(true, [&MnsUsedAtH, &MnsNotUsedAtH](const CDeterministicMNCPtr& dmn){
if (!MnsUsedAtH.ContainsMN(dmn->proTxHash)){
try {
MnsNotUsedAtH.AddMN(dmn);
Expand Down Expand Up @@ -609,7 +609,7 @@ std::set<size_t> CLLMQUtils::CalcDeterministicWatchConnections(Consensus::LLMQTy

bool CLLMQUtils::EnsureQuorumConnections(const Consensus::LLMQParams& llmqParams, const CBlockIndex* pQuorumBaseBlockIndex, const uint256& myProTxHash)
{
auto members = GetAllQuorumMembers(llmqParams, pQuorumBaseBlockIndex);
auto members = GetAllQuorumMembers(llmqParams.type, pQuorumBaseBlockIndex);
bool isMember = std::find_if(members.begin(), members.end(), [&](const auto& dmn) { return dmn->proTxHash == myProTxHash; }) != members.end();

if (!isMember && !CLLMQUtils::IsWatchQuorumsEnabled()) {
Expand Down

0 comments on commit 2a470a4

Please sign in to comment.