Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/llmq/commitment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bool CFinalCommitment::VerifySignatureAsync(CDeterministicMNManager& dmnman, CQu
LogPrint(BCLog::LLMQ, "CFinalCommitment::%s members[%s] quorumPublicKey[%s] commitmentHash[%s]\n", __func__,
ss3.str(), quorumPublicKey.ToString(), commitmentHash.ToString());
}
if (llmq_params.size == 1) {
if (llmq_params.is_single_member()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's change this one too

if (llmq_params.size != 1 && quorumVvecHash.IsNull()) {

LogPrintf("pubkey operator: %s\n", members[0]->pdmnState->pubKeyOperator.Get().ToString());
if (!membersSig.VerifyInsecure(members[0]->pdmnState->pubKeyOperator.Get(), commitmentHash)) {
LogPrint(BCLog::LLMQ, "CFinalCommitment -- q[%s] invalid member signature\n", quorumHash.ToString());
Expand Down Expand Up @@ -138,7 +138,7 @@ bool CFinalCommitment::Verify(CDeterministicMNManager& dmnman, CQuorumSnapshotMa
LogPrint(BCLog::LLMQ, "CFinalCommitment -- q[%s] invalid quorumPublicKey\n", quorumHash.ToString());
return false;
}
if (llmq_params.size != 1 && quorumVvecHash.IsNull()) {
if (!llmq_params.is_single_member() && quorumVvecHash.IsNull()) {
LogPrint(BCLog::LLMQ, "CFinalCommitment -- q[%s] invalid quorumVvecHash\n", quorumHash.ToString());
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsessionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void CDKGSessionHandler::HandleDKGRound(CConnman& connman, PeerManager& peerman)
return changed;
});

if (params.size == 1) {
if (params.is_single_member()) {
auto finalCommitment = curSession->FinalizeSingleCommitment();
if (!finalCommitment.IsNull()) { // it can be null only if we are not member
if (auto inv_opt = quorumBlockProcessor.AddMineableCommitment(finalCommitment); inv_opt.has_value()) {
Expand Down
1 change: 1 addition & 0 deletions src/llmq/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct LLMQParams {

// For how many blocks recent DKG info should be kept
[[nodiscard]] constexpr int max_store_depth() const { return max_cycles(keepOldKeys) * dkgInterval; }
[[nodiscard]] constexpr bool is_single_member() const { return size == 1; }
};

//static_assert(std::is_trivial_v<Consensus::LLMQParams>, "LLMQParams is not a trivial type");
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ void CSigSharesManager::TryRecoverSig(PeerManager& peerman, const CQuorumCPtr& q
return;
}

if (quorum->params.size == 1) {
if (quorum->params.is_single_member()) {
if (sigSharesForSignHash->empty()) {
LogPrint(BCLog::LLMQ_SIGS, /* Continued */
"CSigSharesManager::%s -- impossible to recover single-node signature - no shares yet. id=%s, "
Expand Down Expand Up @@ -1550,7 +1550,7 @@ std::optional<CSigShare> CSigSharesManager::CreateSigShare(const CQuorumCPtr& qu
return std::nullopt;
}

if (quorum->params.size == 1) {
if (quorum->params.is_single_member()) {
int memberIdx = quorum->GetMemberIndex(activeMasterNodeProTxHash);
if (memberIdx == -1) {
// this should really not happen (IsValidMember gave true)
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/quorums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ static UniValue BuildQuorumInfo(const llmq::CQuorumBlockProcessor& quorum_block_
mo.pushKV("pubKeyOperator", dmn->pdmnState->pubKeyOperator.ToString());
mo.pushKV("valid", static_cast<bool>(quorum->qc->validMembers[i]));
if (quorum->qc->validMembers[i]) {
if (quorum->params.size == 1) {
if (quorum->params.is_single_member()) {
mo.pushKV("pubKeyShare", dmn->pdmnState->pubKeyOperator.ToString());
} else {
CBLSPublicKey pubKey = quorum->GetPubKeyShare(i);
Expand Down
Loading