@@ -222,7 +222,7 @@ bool CQuorumBlockProcessor::ProcessCommitment(int nHeight, const uint256& blockH
222222    }
223223    const  auto & llmq_params = llmq_params_opt.value ();
224224
225-     uint256 quorumHash = GetQuorumBlockHash (llmq_params, nHeight, qc.quorumIndex );
225+     uint256 quorumHash = GetQuorumBlockHash (llmq_params, m_chainstate. m_chain ,  nHeight, qc.quorumIndex );
226226
227227    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__,
228228             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
420420    size_t  ret{0 };
421421
422422    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);
424424        if  (!quorumHash.IsNull () && !HasMinedCommitment (llmqParams.type , quorumHash)) ++ret;
425425    }
426426
427427    return  ret;
428428}
429429
430430//  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)
432432{
433433    AssertLockHeld (cs_main);
434434
435435    int  quorumStartHeight = nHeight - (nHeight % llmqParams.dkgInterval ) + quorumIndex;
436436
437437    uint256 quorumBlockHash;
438-     if  (!GetBlockHash (quorumBlockHash, quorumStartHeight)) {
438+     if  (!GetBlockHash (active_chain,  quorumBlockHash, quorumStartHeight)) {
439439        LogPrint (BCLog::LLMQ, " [GetQuorumBlockHash] llmqType[%d] h[%d] qi[%d] quorumStartHeight[%d] quorumHash[EMPTY]\n "  , ToUnderlying (llmqParams.type ), nHeight, quorumIndex, quorumStartHeight);
440440        return  {};
441441    }
@@ -705,7 +705,7 @@ std::optional<std::vector<CFinalCommitment>> CQuorumBlockProcessor::GetMineableC
705705    for  (const  auto  quorumIndex : irange::range (quorums_num)) {
706706        CFinalCommitment cf;
707707
708-         uint256 quorumHash = GetQuorumBlockHash (llmqParams, nHeight, quorumIndex);
708+         uint256 quorumHash = GetQuorumBlockHash (llmqParams, m_chainstate. m_chain ,  nHeight, quorumIndex);
709709        if  (quorumHash.IsNull ()) {
710710            break ;
711711        }
0 commit comments