@@ -222,7 +222,7 @@ bool CQuorumBlockProcessor::ProcessCommitment(int nHeight, const uint256& blockH
222
222
}
223
223
const auto & llmq_params = llmq_params_opt.value ();
224
224
225
- uint256 quorumHash = GetQuorumBlockHash (llmq_params, nHeight, qc.quorumIndex );
225
+ uint256 quorumHash = GetQuorumBlockHash (llmq_params, m_chainstate. m_chain , nHeight, qc.quorumIndex );
226
226
227
227
LogPrint (BCLog::LLMQ, " CQuorumBlockProcessor::%s height=%d, type=%d, quorumIndex=%d, quorumHash=%s, signers=%s, validMembers=%d, quorumPublicKey=%s fJustCheck[%d] processing commitment from block.\n " , __func__,
228
228
nHeight, ToUnderlying (qc.llmqType ), qc.quorumIndex , quorumHash.ToString (), qc.CountSigners (), qc.CountValidMembers (), qc.quorumPublicKey .ToString (), fJustCheck );
@@ -420,22 +420,22 @@ size_t CQuorumBlockProcessor::GetNumCommitmentsRequired(const Consensus::LLMQPar
420
420
size_t ret{0 };
421
421
422
422
for (const auto quorumIndex : irange::range (quorums_num)) {
423
- uint256 quorumHash = GetQuorumBlockHash (llmqParams, nHeight, quorumIndex);
423
+ uint256 quorumHash = GetQuorumBlockHash (llmqParams, m_chainstate. m_chain , nHeight, quorumIndex);
424
424
if (!quorumHash.IsNull () && !HasMinedCommitment (llmqParams.type , quorumHash)) ++ret;
425
425
}
426
426
427
427
return ret;
428
428
}
429
429
430
430
// WARNING: This method returns uint256() on the first block of the DKG interval (because the block hash is not known yet)
431
- uint256 CQuorumBlockProcessor::GetQuorumBlockHash (const Consensus::LLMQParams& llmqParams, int nHeight, int quorumIndex)
431
+ uint256 CQuorumBlockProcessor::GetQuorumBlockHash (const Consensus::LLMQParams& llmqParams, const CChain& active_chain, int nHeight, int quorumIndex)
432
432
{
433
433
AssertLockHeld (cs_main);
434
434
435
435
int quorumStartHeight = nHeight - (nHeight % llmqParams.dkgInterval ) + quorumIndex;
436
436
437
437
uint256 quorumBlockHash;
438
- if (!GetBlockHash (quorumBlockHash, quorumStartHeight)) {
438
+ if (!GetBlockHash (active_chain, quorumBlockHash, quorumStartHeight)) {
439
439
LogPrint (BCLog::LLMQ, " [GetQuorumBlockHash] llmqType[%d] h[%d] qi[%d] quorumStartHeight[%d] quorumHash[EMPTY]\n " , ToUnderlying (llmqParams.type ), nHeight, quorumIndex, quorumStartHeight);
440
440
return {};
441
441
}
@@ -705,7 +705,7 @@ std::optional<std::vector<CFinalCommitment>> CQuorumBlockProcessor::GetMineableC
705
705
for (const auto quorumIndex : irange::range (quorums_num)) {
706
706
CFinalCommitment cf;
707
707
708
- uint256 quorumHash = GetQuorumBlockHash (llmqParams, nHeight, quorumIndex);
708
+ uint256 quorumHash = GetQuorumBlockHash (llmqParams, m_chainstate. m_chain , nHeight, quorumIndex);
709
709
if (quorumHash.IsNull ()) {
710
710
break ;
711
711
}
0 commit comments