Skip to content

Commit

Permalink
scripted-diff: Refactor llmq type consensus param names (dashpay#3093)
Browse files Browse the repository at this point in the history
-BEGIN VERIFY SCRIPT-
sed -i 's/llmqChainLocks/llmqTypeChainLocks/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h
sed -i 's/llmqForInstantSend/llmqTypeInstantSend/g' src/*.cpp src/*.h src/*/*.cpp src/*/*.h
-END VERIFY SCRIPT-
  • Loading branch information
UdjinM6 authored and panleone committed Nov 10, 2024
1 parent effcbed commit b30d7f5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ class CMainParams : public CChainParams

nLLMQConnectionRetryTimeout = 60;

consensus.llmqChainLocks = Consensus::LLMQ_400_60;
consensus.llmqTypeChainLocks = Consensus::LLMQ_400_60;

// Tier two
nFulfilledRequestExpireTime = 60 * 60; // fulfilled requests expire in 1 hour
Expand Down Expand Up @@ -505,7 +505,7 @@ class CTestNetParams : public CChainParams

nLLMQConnectionRetryTimeout = 60;

consensus.llmqChainLocks = Consensus::LLMQ_400_60;
consensus.llmqTypeChainLocks = Consensus::LLMQ_400_60;

// Tier two
nFulfilledRequestExpireTime = 60 * 60; // fulfilled requests expire in 1 hour
Expand Down Expand Up @@ -649,7 +649,7 @@ class CRegTestParams : public CChainParams
consensus.llmqs[Consensus::LLMQ_TEST] = llmq_test;
nLLMQConnectionRetryTimeout = 10;

consensus.llmqChainLocks = Consensus::LLMQ_TEST;
consensus.llmqTypeChainLocks = Consensus::LLMQ_TEST;

// Tier two
nFulfilledRequestExpireTime = 60 * 60; // fulfilled requests expire in 1 hour
Expand Down
2 changes: 1 addition & 1 deletion src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ struct Params {
// LLMQ
std::map<LLMQType, LLMQParams> llmqs;
Optional<LLMQParams> GetLLMQParams(uint8_t llmqtype) const;
LLMQType llmqChainLocks;
LLMQType llmqTypeChainLocks;
};
} // namespace Consensus

Expand Down
4 changes: 2 additions & 2 deletions src/llmq/quorums_chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void CChainLocksHandler::ProcessNewChainLock(NodeId from, const llmq::CChainLock

uint256 requestId = ::SerializeHash(std::make_pair(CLSIG_REQUESTID_PREFIX, clsig.nHeight));
uint256 msgHash = clsig.blockHash;
if (!quorumSigningManager->VerifyRecoveredSig(Params().GetConsensus().llmqChainLocks, clsig.nHeight, requestId, msgHash, clsig.sig)) {
if (!quorumSigningManager->VerifyRecoveredSig(Params().GetConsensus().llmqTypeChainLocks, clsig.nHeight, requestId, msgHash, clsig.sig)) {
LogPrintf("CChainLocksHandler::%s -- invalid CLSIG (%s), peer=%d\n", __func__, clsig.ToString(), from);
if (from != -1) {
LOCK(cs_main);
Expand Down Expand Up @@ -270,7 +270,7 @@ void CChainLocksHandler::TrySignChainTip()
lastSignedMsgHash = msgHash;
}

quorumSigningManager->AsyncSignIfMember(Params().GetConsensus().llmqChainLocks, requestId, msgHash);
quorumSigningManager->AsyncSignIfMember(Params().GetConsensus().llmqTypeChainLocks, requestId, msgHash);
}

// WARNING: cs_main and cs should not be held!
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums_signing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ CQuorumCPtr CSigningManager::SelectQuorumForSigning(Consensus::LLMQType llmqType

bool CSigningManager::VerifyRecoveredSig(Consensus::LLMQType llmqType, int signedAtHeight, const uint256& id, const uint256& msgHash, const CBLSSignature& sig)
{
auto& llmqParams = Params().GetConsensus().llmqs.at(Params().GetConsensus().llmqChainLocks);
auto& llmqParams = Params().GetConsensus().llmqs.at(Params().GetConsensus().llmqTypeChainLocks);

auto quorum = SelectQuorumForSigning(llmqParams.type, signedAtHeight, id);
if (!quorum) {
Expand Down

0 comments on commit b30d7f5

Please sign in to comment.