From 405b8c669add36bd3c53f080325cba0c336ca007 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Wed, 28 Feb 2024 11:42:36 +0000 Subject: [PATCH] refactor: s/sporkManager/sporkman/g sporkManager was the name of the global that's been removed a commit ago, remove variable names that could be misread as the global still existing --- contrib/auto_gdb/debug.gdb | 2 +- src/governance/governance.cpp | 4 ++-- src/governance/governance.h | 2 +- src/llmq/chainlocks.cpp | 12 ++++++------ src/llmq/chainlocks.h | 6 +++--- src/llmq/dkgsessionmgr.cpp | 8 ++++---- src/llmq/dkgsessionmgr.h | 4 ++-- src/llmq/instantsend.h | 4 ++-- src/llmq/signing_shares.cpp | 4 ++-- src/llmq/signing_shares.h | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/contrib/auto_gdb/debug.gdb b/contrib/auto_gdb/debug.gdb index e8c9ba9c4c..b0f0c0f27b 100644 --- a/contrib/auto_gdb/debug.gdb +++ b/contrib/auto_gdb/debug.gdb @@ -7,6 +7,6 @@ source test_used_size.gdb #logsize mnodeman "memlog.txt" logsize mnpayments "memlog.txt" #logsize instantsend "memlog.txt" -#logsize sporkManager "memlog.txt" +#logsize sporkman "memlog.txt" #logsize masternodeSync "memlog.txt" #logsize governance "memlog.txt" diff --git a/src/governance/governance.cpp b/src/governance/governance.cpp index f152669b13..ac443aac18 100644 --- a/src/governance/governance.cpp +++ b/src/governance/governance.cpp @@ -1563,7 +1563,7 @@ void CGovernanceManager::RemoveInvalidVotes() lastMNListForVotingKeys = std::make_shared(curMNList); } -bool AreSuperblocksEnabled(const CSporkManager& sporkManager) +bool AreSuperblocksEnabled(const CSporkManager& sporkman) { - return sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED); + return sporkman.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED); } diff --git a/src/governance/governance.h b/src/governance/governance.h index 5186941305..f47a6786c1 100644 --- a/src/governance/governance.h +++ b/src/governance/governance.h @@ -403,6 +403,6 @@ private: }; -bool AreSuperblocksEnabled(const CSporkManager& sporkManager); +bool AreSuperblocksEnabled(const CSporkManager& sporkman); #endif // BITCOIN_GOVERNANCE_GOVERNANCE_H diff --git a/src/llmq/chainlocks.cpp b/src/llmq/chainlocks.cpp index ae72bdf1a2..22294c107f 100644 --- a/src/llmq/chainlocks.cpp +++ b/src/llmq/chainlocks.cpp @@ -26,7 +26,7 @@ namespace llmq std::unique_ptr chainLocksHandler; CChainLocksHandler::CChainLocksHandler(CChainState& chainstate, CConnman& _connman, CMasternodeSync& mn_sync, CQuorumManager& _qman, - CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkManager, + CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkman, CTxMemPool& _mempool) : m_chainstate(chainstate), connman(_connman), @@ -34,7 +34,7 @@ CChainLocksHandler::CChainLocksHandler(CChainState& chainstate, CConnman& _connm qman(_qman), sigman(_sigman), shareman(_shareman), - spork_manager(sporkManager), + spork_manager(sporkman), mempool(_mempool), scheduler(std::make_unique()), scheduler_thread(std::make_unique(std::thread(util::TraceThread, "cl-schdlr", [&] { scheduler->serviceQueue(); }))) @@ -668,14 +668,14 @@ void CChainLocksHandler::Cleanup() lastCleanupTime = GetTimeMillis(); } -bool AreChainLocksEnabled(const CSporkManager& sporkManager) +bool AreChainLocksEnabled(const CSporkManager& sporkman) { - return sporkManager.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED); + return sporkman.IsSporkActive(SPORK_19_CHAINLOCKS_ENABLED); } -bool ChainLocksSigningEnabled(const CSporkManager& sporkManager) +bool ChainLocksSigningEnabled(const CSporkManager& sporkman) { - return sporkManager.GetSporkValue(SPORK_19_CHAINLOCKS_ENABLED) == 0; + return sporkman.GetSporkValue(SPORK_19_CHAINLOCKS_ENABLED) == 0; } } // namespace llmq diff --git a/src/llmq/chainlocks.h b/src/llmq/chainlocks.h index 71737b8718..9ee1dab921 100644 --- a/src/llmq/chainlocks.h +++ b/src/llmq/chainlocks.h @@ -86,7 +86,7 @@ private: public: explicit CChainLocksHandler(CChainState& chainstate, CConnman& _connman, CMasternodeSync& mn_sync, CQuorumManager& _qman, - CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkManager, + CSigningManager& _sigman, CSigSharesManager& _shareman, CSporkManager& sporkman, CTxMemPool& _mempool); ~CChainLocksHandler(); @@ -128,8 +128,8 @@ private: extern std::unique_ptr chainLocksHandler; -bool AreChainLocksEnabled(const CSporkManager& sporkManager); -bool ChainLocksSigningEnabled(const CSporkManager& sporkManager); +bool AreChainLocksEnabled(const CSporkManager& sporkman); +bool ChainLocksSigningEnabled(const CSporkManager& sporkman); } // namespace llmq diff --git a/src/llmq/dkgsessionmgr.cpp b/src/llmq/dkgsessionmgr.cpp index 3b4ad78e79..3d6a9b2e04 100644 --- a/src/llmq/dkgsessionmgr.cpp +++ b/src/llmq/dkgsessionmgr.cpp @@ -25,7 +25,7 @@ static const std::string DB_SKCONTRIB = "qdkg_S"; static const std::string DB_ENC_CONTRIB = "qdkg_E"; CDKGSessionManager::CDKGSessionManager(CBLSWorker& _blsWorker, CChainState& chainstate, CConnman& _connman, CDKGDebugManager& _dkgDebugManager, - CQuorumBlockProcessor& _quorumBlockProcessor, const CSporkManager& sporkManager, + CQuorumBlockProcessor& _quorumBlockProcessor, const CSporkManager& sporkman, bool unitTests, bool fWipe) : db(std::make_unique(unitTests ? "" : (GetDataDir() / "llmq/dkgdb"), 1 << 20, unitTests, fWipe)), blsWorker(_blsWorker), @@ -33,7 +33,7 @@ CDKGSessionManager::CDKGSessionManager(CBLSWorker& _blsWorker, CChainState& chai connman(_connman), dkgDebugManager(_dkgDebugManager), quorumBlockProcessor(_quorumBlockProcessor), - spork_manager(sporkManager) + spork_manager(sporkman) { if (!fMasternodeMode && !IsWatchQuorumsEnabled()) { // Regular nodes do not care about any DKG internals, bail out @@ -520,9 +520,9 @@ void CDKGSessionManager::CleanupOldContributions() const } } -bool IsQuorumDKGEnabled(const CSporkManager& sporkManager) +bool IsQuorumDKGEnabled(const CSporkManager& sporkman) { - return sporkManager.IsSporkActive(SPORK_17_QUORUM_DKG_ENABLED); + return sporkman.IsSporkActive(SPORK_17_QUORUM_DKG_ENABLED); } } // namespace llmq diff --git a/src/llmq/dkgsessionmgr.h b/src/llmq/dkgsessionmgr.h index 7d2f12fbf0..5278bbdc83 100644 --- a/src/llmq/dkgsessionmgr.h +++ b/src/llmq/dkgsessionmgr.h @@ -64,7 +64,7 @@ private: public: CDKGSessionManager(CBLSWorker& _blsWorker, CChainState& chainstate, CConnman& _connman, CDKGDebugManager& _dkgDebugManager, - CQuorumBlockProcessor& _quorumBlockProcessor, const CSporkManager& sporkManager, + CQuorumBlockProcessor& _quorumBlockProcessor, const CSporkManager& sporkman, bool unitTests, bool fWipe); ~CDKGSessionManager() = default; @@ -96,7 +96,7 @@ private: void CleanupCache() const; }; -bool IsQuorumDKGEnabled(const CSporkManager& sporkManager); +bool IsQuorumDKGEnabled(const CSporkManager& sporkman); } // namespace llmq #endif // BITCOIN_LLMQ_DKGSESSIONMGR_H diff --git a/src/llmq/instantsend.h b/src/llmq/instantsend.h index 70c764a7a3..bddf057f6a 100644 --- a/src/llmq/instantsend.h +++ b/src/llmq/instantsend.h @@ -256,11 +256,11 @@ private: public: explicit CInstantSendManager(CChainLocksHandler& _clhandler, CChainState& chainstate, CConnman& _connman, CQuorumManager& _qman, CSigningManager& _sigman, CSigSharesManager& _shareman, - CSporkManager& sporkManager, CTxMemPool& _mempool, const CMasternodeSync& mn_sync, + CSporkManager& sporkman, CTxMemPool& _mempool, const CMasternodeSync& mn_sync, bool unitTests, bool fWipe) : db(unitTests, fWipe), clhandler(_clhandler), m_chainstate(chainstate), connman(_connman), qman(_qman), sigman(_sigman), - shareman(_shareman), spork_manager(sporkManager), mempool(_mempool), m_mn_sync(mn_sync) + shareman(_shareman), spork_manager(sporkman), mempool(_mempool), m_mn_sync(mn_sync) { workInterrupt.reset(); } diff --git a/src/llmq/signing_shares.cpp b/src/llmq/signing_shares.cpp index 89b8b5a526..4032d38758 100644 --- a/src/llmq/signing_shares.cpp +++ b/src/llmq/signing_shares.cpp @@ -215,14 +215,14 @@ void CSigSharesManager::InterruptWorkerThread() workInterrupt(); } -void CSigSharesManager::ProcessMessage(const CNode& pfrom, const CSporkManager& sporkManager, const std::string& msg_type, CDataStream& vRecv) +void CSigSharesManager::ProcessMessage(const CNode& pfrom, const CSporkManager& sporkman, const std::string& msg_type, CDataStream& vRecv) { // non-masternodes are not interested in sigshares if (!fMasternodeMode || WITH_LOCK(activeMasternodeInfoCs, return activeMasternodeInfo.proTxHash.IsNull())) { return; } - if (sporkManager.IsSporkActive(SPORK_21_QUORUM_ALL_CONNECTED) && msg_type == NetMsgType::QSIGSHARE) { + if (sporkman.IsSporkActive(SPORK_21_QUORUM_ALL_CONNECTED) && msg_type == NetMsgType::QSIGSHARE) { std::vector receivedSigShares; vRecv >> receivedSigShares; diff --git a/src/llmq/signing_shares.h b/src/llmq/signing_shares.h index b438a22fef..173c7d0395 100644 --- a/src/llmq/signing_shares.h +++ b/src/llmq/signing_shares.h @@ -424,7 +424,7 @@ public: void UnregisterAsRecoveredSigsListener(); void InterruptWorkerThread(); - void ProcessMessage(const CNode& pnode, const CSporkManager& sporkManager, const std::string& msg_type, CDataStream& vRecv); + void ProcessMessage(const CNode& pnode, const CSporkManager& sporkman, const std::string& msg_type, CDataStream& vRecv); void AsyncSign(const CQuorumCPtr& quorum, const uint256& id, const uint256& msgHash); std::optional CreateSigShare(const CQuorumCPtr& quorum, const uint256& id, const uint256& msgHash) const;