Skip to content

Commit

Permalink
fix: added missing const and removed non-used argument in CEHFSignals…
Browse files Browse the repository at this point in the history
…Handler constructor
  • Loading branch information
knst committed Oct 17, 2023
1 parent 34c66ff commit 7e96c96
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
llmq::quorumSnapshotManager.reset();
llmq::quorumSnapshotManager.reset(new llmq::CQuorumSnapshotManager(*node.evodb));
node.llmq_ctx.reset();
node.llmq_ctx.reset(new LLMQContext(chainman.ActiveChainstate(), *node.connman, *node.evodb, *::sporkManager, *node.mnhf_manager, *node.mempool, node.peerman, false, fReset || fReindexChainState));
node.llmq_ctx.reset(new LLMQContext(chainman.ActiveChainstate(), *node.connman, *node.evodb, *::sporkManager, *node.mempool, node.peerman, false, fReset || fReindexChainState));

if (fReset) {
pblocktree->WriteReindexing(true);
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <llmq/utils.h>
#include <masternode/sync.h>

LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman, CMNHFManager& mnhfman, CTxMemPool& mempool,
LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman, CTxMemPool& mempool,
const std::unique_ptr<PeerManager>& peerman, bool unit_tests, bool wipe) :
bls_worker{std::make_shared<CBLSWorker>()},
dkg_debugman{std::make_unique<llmq::CDKGDebugManager>()},
Expand All @@ -47,7 +47,7 @@ LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo
llmq::quorumInstantSendManager = std::make_unique<llmq::CInstantSendManager>(*llmq::chainLocksHandler, chainstate, connman, *llmq::quorumManager, *sigman, *shareman, sporkman, mempool, *::masternodeSync, peerman, unit_tests, wipe);
return llmq::quorumInstantSendManager.get();
}()},
ehfSignalsHandler{std::make_unique<llmq::CEHFSignalsHandler>(chainstate, connman, *sigman, *shareman, sporkman, *llmq::quorumManager, mempool, mnhfman)}
ehfSignalsHandler{std::make_unique<llmq::CEHFSignalsHandler>(chainstate, connman, *sigman, *shareman, sporkman, *llmq::quorumManager, mempool)}
{
// NOTE: we use this only to wipe the old db, do NOT use it for anything else
// TODO: remove it in some future version
Expand Down
3 changes: 1 addition & 2 deletions src/llmq/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class CChainState;
class CConnman;
class CDBWrapper;
class CEvoDB;
class CMNHFManager;
class CSporkManager;
class CTxMemPool;
class PeerManager;
Expand All @@ -33,7 +32,7 @@ struct LLMQContext {
LLMQContext() = delete;
LLMQContext(const LLMQContext&) = delete;
LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman,
CMNHFManager& mnhfman, CTxMemPool& mempool,
CTxMemPool& mempool,
const std::unique_ptr<PeerManager>& peerman, bool unit_tests, bool wipe);
~LLMQContext();

Expand Down
6 changes: 2 additions & 4 deletions src/llmq/ehf_signals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ namespace llmq {

CEHFSignalsHandler::CEHFSignalsHandler(CChainState& chainstate, CConnman& connman,
CSigningManager& sigman, CSigSharesManager& shareman,
CSporkManager& sporkman, CQuorumManager& qman, CTxMemPool& mempool,
CMNHFManager& mnhfManager) :
const CSporkManager& sporkman, const CQuorumManager& qman, CTxMemPool& mempool) :
chainstate(chainstate),
connman(connman),
sigman(sigman),
shareman(shareman),
sporkman(sporkman),
qman(qman),
mempool(mempool),
mnhfManager(mnhfManager)
mempool(mempool)
{
sigman.RegisterRecoveredSigsListener(this);
}
Expand Down
9 changes: 3 additions & 6 deletions src/llmq/ehf_signals.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
class CBlockIndex;
class CChainState;
class CConnman;
class CMNHFManager;
class CSporkManager;
class CTxMemPool;

Expand All @@ -29,10 +28,9 @@ class CEHFSignalsHandler : public CRecoveredSigsListener
CConnman& connman;
CSigningManager& sigman;
CSigSharesManager& shareman;
CSporkManager& sporkman;
CQuorumManager& qman;
const CSporkManager& sporkman;
const CQuorumManager& qman;
CTxMemPool& mempool;
CMNHFManager& mnhfManager;

/**
* keep freshly generated IDs for easier filter sigs in HandleNewRecoveredSig
Expand All @@ -42,8 +40,7 @@ class CEHFSignalsHandler : public CRecoveredSigsListener
public:
explicit CEHFSignalsHandler(CChainState& chainstate, CConnman& connman,
CSigningManager& sigman, CSigSharesManager& shareman,
CSporkManager& sporkman, CQuorumManager& qman, CTxMemPool& mempool,
CMNHFManager& mnhfManager);
const CSporkManager& sporkman, const CQuorumManager& qman, CTxMemPool& mempool);
~CEHFSignalsHandler();


Expand Down
2 changes: 1 addition & 1 deletion src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void DashTestSetup(NodeContext& node)

node.cj_ctx = std::make_unique<CJContext>(chainstate, *node.connman, *node.mempool, *::masternodeSync, /* relay_txes */ true);
::deterministicMNManager = std::make_unique<CDeterministicMNManager>(chainstate, *node.connman, *node.evodb);
node.llmq_ctx = std::make_unique<LLMQContext>(chainstate, *node.connman, *node.evodb, *sporkManager, *node.mnhf_manager, *node.mempool, node.peerman, true, false);
node.llmq_ctx = std::make_unique<LLMQContext>(chainstate, *node.connman, *node.evodb, *sporkManager, *node.mempool, node.peerman, true, false);
}

void DashTestSetupClose(NodeContext& node)
Expand Down

0 comments on commit 7e96c96

Please sign in to comment.