@@ -1107,25 +1107,26 @@ void CQuorumManager::StartCleanupOldQuorumDataThread(const CBlockIndex* pIndex)
11071107    });
11081108}
11091109
1110- CQuorumCPtr SelectQuorumForSigning (const  Consensus::LLMQParams& llmq_params, const  CQuorumManager& quorum_manager, const  uint256& selectionHash, int  signHeight, int  signOffset)
1110+ CQuorumCPtr SelectQuorumForSigning (const  Consensus::LLMQParams& llmq_params, const  CChain& active_chain, const  CQuorumManager& qman,
1111+                                    const  uint256& selectionHash, int  signHeight, int  signOffset)
11111112{
11121113    size_t  poolSize = llmq_params.signingActiveQuorumCount ;
11131114
11141115    CBlockIndex* pindexStart;
11151116    {
11161117        LOCK (cs_main);
11171118        if  (signHeight == -1 ) {
1118-             signHeight = :: ChainActive () .Height ();
1119+             signHeight = active_chain .Height ();
11191120        }
11201121        int  startBlockHeight = signHeight - signOffset;
1121-         if  (startBlockHeight > :: ChainActive () .Height () || startBlockHeight < 0 ) {
1122+         if  (startBlockHeight > active_chain .Height () || startBlockHeight < 0 ) {
11221123            return  {};
11231124        }
1124-         pindexStart = :: ChainActive () [startBlockHeight];
1125+         pindexStart = active_chain [startBlockHeight];
11251126    }
11261127
11271128    if  (IsQuorumRotationEnabled (llmq_params, pindexStart)) {
1128-         auto  quorums = quorum_manager .ScanQuorums (llmq_params.type , pindexStart, poolSize);
1129+         auto  quorums = qman .ScanQuorums (llmq_params.type , pindexStart, poolSize);
11291130        if  (quorums.empty ()) {
11301131            return  nullptr ;
11311132        }
@@ -1149,7 +1150,7 @@ CQuorumCPtr SelectQuorumForSigning(const Consensus::LLMQParams& llmq_params, con
11491150        }
11501151        return  *itQuorum;
11511152    } else  {
1152-         auto  quorums = quorum_manager .ScanQuorums (llmq_params.type , pindexStart, poolSize);
1153+         auto  quorums = qman .ScanQuorums (llmq_params.type , pindexStart, poolSize);
11531154        if  (quorums.empty ()) {
11541155            return  nullptr ;
11551156        }
@@ -1168,11 +1169,13 @@ CQuorumCPtr SelectQuorumForSigning(const Consensus::LLMQParams& llmq_params, con
11681169    }
11691170}
11701171
1171- bool  VerifyRecoveredSig (Consensus::LLMQType llmqType, const  CQuorumManager& quorum_manager, int  signedAtHeight, const  uint256& id, const  uint256& msgHash, const  CBLSSignature& sig, const  int  signOffset)
1172+ bool  VerifyRecoveredSig (Consensus::LLMQType llmqType, const  CChain& active_chain, const  CQuorumManager& qman,
1173+                         int  signedAtHeight, const  uint256& id, const  uint256& msgHash, const  CBLSSignature& sig,
1174+                         const  int  signOffset)
11721175{
11731176    const  auto & llmq_params_opt = Params ().GetLLMQ (llmqType);
11741177    assert (llmq_params_opt.has_value ());
1175-     auto  quorum = SelectQuorumForSigning (llmq_params_opt.value (), quorum_manager , id, signedAtHeight, signOffset);
1178+     auto  quorum = SelectQuorumForSigning (llmq_params_opt.value (), active_chain, qman , id, signedAtHeight, signOffset);
11761179    if  (!quorum) {
11771180        return  false ;
11781181    }
0 commit comments