@@ -94,9 +94,9 @@ bool CQuorum::SetVerificationVector(const std::vector<CBLSPublicKey>& quorumVecI
9494 return true ;
9595}
9696
97- bool CQuorum::SetSecretKeyShare (const CBLSSecretKey& secretKeyShare, const CActiveMasternodeManager& mn_activeman )
97+ bool CQuorum::SetSecretKeyShare (const CBLSSecretKey& secretKeyShare, const uint256& protx_hash )
9898{
99- if (!secretKeyShare.IsValid () || (secretKeyShare.GetPublicKey () != GetPubKeyShare (GetMemberIndex (mn_activeman. GetProTxHash () )))) {
99+ if (!secretKeyShare.IsValid () || (secretKeyShare.GetPublicKey () != GetPubKeyShare (GetMemberIndex (protx_hash )))) {
100100 return false ;
101101 }
102102 LOCK (cs_vvec_shShare);
@@ -460,7 +460,7 @@ bool CQuorumManager::BuildQuorumContributions(const CFinalCommitmentPtr& fqc, co
460460 // allows to use the quorum as a non-member (verification through the quorum pub key)
461461 return false ;
462462 }
463- if (!quorum-> SetSecretKeyShare (blsWorker. AggregateSecretKeys (skContributions), *m_mn_activeman )) {
463+ if (m_mn_activeman && ! SetQuorumSecretKeyShare (*quorum, skContributions )) {
464464 LogPrint (BCLog::LLMQ, " CQuorumManager::%s -- failed to build skShare\n " , __func__);
465465 // We don't bail out here as this is not a fatal error and still allows us to recover public key shares (as we
466466 // have a valid quorum vvec at this point)
@@ -472,6 +472,12 @@ bool CQuorumManager::BuildQuorumContributions(const CFinalCommitmentPtr& fqc, co
472472 return true ;
473473}
474474
475+ bool CQuorumManager::SetQuorumSecretKeyShare (CQuorum& quorum, Span<CBLSSecretKey> skContributions) const
476+ {
477+ assert (m_mn_activeman);
478+ return quorum.SetSecretKeyShare (blsWorker.AggregateSecretKeys (skContributions), m_mn_activeman->GetProTxHash ());
479+ }
480+
475481bool CQuorumManager::HasQuorum (Consensus::LLMQType llmqType, const CQuorumBlockProcessor& quorum_block_processor, const uint256& quorumHash)
476482{
477483 return quorum_block_processor.HasMinedCommitment (llmqType, quorumHash);
@@ -758,8 +764,7 @@ MessageProcessingResult CQuorumManager::ProcessContribQDATA(CNode& pfrom, CDataS
758764 }
759765 }
760766
761- CBLSSecretKey secretKeyShare = blsWorker.AggregateSecretKeys (vecSecretKeys);
762- if (!quorum.SetSecretKeyShare (secretKeyShare, *m_mn_activeman)) {
767+ if (!quorum.SetSecretKeyShare (blsWorker.AggregateSecretKeys (vecSecretKeys), m_mn_activeman->GetProTxHash ())) {
763768 return MisbehavingError{10 , " invalid secret key share received" };
764769 }
765770 }
0 commit comments