@@ -1107,25 +1107,26 @@ void CQuorumManager::StartCleanupOldQuorumDataThread(const CBlockIndex* pIndex)
1107
1107
});
1108
1108
}
1109
1109
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)
1111
1112
{
1112
1113
size_t poolSize = llmq_params.signingActiveQuorumCount ;
1113
1114
1114
1115
CBlockIndex* pindexStart;
1115
1116
{
1116
1117
LOCK (cs_main);
1117
1118
if (signHeight == -1 ) {
1118
- signHeight = :: ChainActive () .Height ();
1119
+ signHeight = active_chain .Height ();
1119
1120
}
1120
1121
int startBlockHeight = signHeight - signOffset;
1121
- if (startBlockHeight > :: ChainActive () .Height () || startBlockHeight < 0 ) {
1122
+ if (startBlockHeight > active_chain .Height () || startBlockHeight < 0 ) {
1122
1123
return {};
1123
1124
}
1124
- pindexStart = :: ChainActive () [startBlockHeight];
1125
+ pindexStart = active_chain [startBlockHeight];
1125
1126
}
1126
1127
1127
1128
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);
1129
1130
if (quorums.empty ()) {
1130
1131
return nullptr ;
1131
1132
}
@@ -1149,7 +1150,7 @@ CQuorumCPtr SelectQuorumForSigning(const Consensus::LLMQParams& llmq_params, con
1149
1150
}
1150
1151
return *itQuorum;
1151
1152
} else {
1152
- auto quorums = quorum_manager .ScanQuorums (llmq_params.type , pindexStart, poolSize);
1153
+ auto quorums = qman .ScanQuorums (llmq_params.type , pindexStart, poolSize);
1153
1154
if (quorums.empty ()) {
1154
1155
return nullptr ;
1155
1156
}
@@ -1168,11 +1169,13 @@ CQuorumCPtr SelectQuorumForSigning(const Consensus::LLMQParams& llmq_params, con
1168
1169
}
1169
1170
}
1170
1171
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)
1172
1175
{
1173
1176
const auto & llmq_params_opt = Params ().GetLLMQ (llmqType);
1174
1177
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);
1176
1179
if (!quorum) {
1177
1180
return false ;
1178
1181
}
0 commit comments