Skip to content
4 changes: 4 additions & 0 deletions src/coinjoin/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ PeerMsgRet CCoinJoinClientQueueManager::ProcessMessage(const CNode& peer, std::s

PeerMsgRet CCoinJoinClientQueueManager::ProcessDSQueue(const CNode& peer, CDataStream& vRecv)
{
assert(::mmetaman->IsValid());

CCoinJoinQueue dsq;
vRecv >> dsq;

Expand Down Expand Up @@ -1117,6 +1119,8 @@ bool CCoinJoinClientSession::JoinExistingQueue(CAmount nBalanceNeedsAnonymized,

bool CCoinJoinClientSession::StartNewQueue(CAmount nBalanceNeedsAnonymized, CConnman& connman)
{
assert(::mmetaman->IsValid());

if (!CCoinJoinClientOptions::IsEnabled()) return false;
if (nBalanceNeedsAnonymized <= 0) return false;

Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <coinjoin/server.h>

CJContext::CJContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CTxMemPool& mempool,
const CActiveMasternodeManager* mn_activeman, const CMasternodeSync& mn_sync, bool relay_txes) :
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync, bool relay_txes) :
dstxman{std::make_unique<CDSTXManager>()},
#ifdef ENABLE_WALLET
walletman{std::make_unique<CoinJoinWalletManager>(connman, dmnman, mempool, mn_sync, queueman)},
Expand Down
2 changes: 1 addition & 1 deletion src/coinjoin/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct CJContext {
CJContext() = delete;
CJContext(const CJContext&) = delete;
CJContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CTxMemPool& mempool,
const CActiveMasternodeManager* mn_activeman, const CMasternodeSync& mn_sync, bool relay_txes);
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync, bool relay_txes);
~CJContext();

const std::unique_ptr<CDSTXManager> dstxman;
Expand Down
3 changes: 3 additions & 0 deletions src/coinjoin/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ PeerMsgRet CCoinJoinServer::ProcessMessage(CNode& peer, std::string_view msg_typ
void CCoinJoinServer::ProcessDSACCEPT(CNode& peer, CDataStream& vRecv)
{
assert(m_mn_activeman);
assert(::mmetaman->IsValid());

if (IsSessionReady()) {
// too many users in this session already, reject new ones
Expand Down Expand Up @@ -110,6 +111,8 @@ void CCoinJoinServer::ProcessDSACCEPT(CNode& peer, CDataStream& vRecv)

PeerMsgRet CCoinJoinServer::ProcessDSQUEUE(const CNode& peer, CDataStream& vRecv)
{
assert(::mmetaman->IsValid());

CCoinJoinQueue dsq;
vRecv >> dsq;

Expand Down
4 changes: 2 additions & 2 deletions src/coinjoin/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CCoinJoinServer : public CCoinJoinBaseSession, public CCoinJoinBaseManager
CDeterministicMNManager& m_dmnman;
CDSTXManager& m_dstxman;
CTxMemPool& mempool;
const CActiveMasternodeManager* m_mn_activeman;
const CActiveMasternodeManager* const m_mn_activeman;
const CMasternodeSync& m_mn_sync;

// Mixing uses collateral transactions to trust parties entering the pool
Expand Down Expand Up @@ -87,7 +87,7 @@ class CCoinJoinServer : public CCoinJoinBaseSession, public CCoinJoinBaseManager

public:
explicit CCoinJoinServer(CChainState& chainstate, CConnman& _connman, CDeterministicMNManager& dmnman, CDSTXManager& dstxman,
CTxMemPool& mempool, const CActiveMasternodeManager* mn_activeman, const CMasternodeSync& mn_sync) :
CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync) :
m_chainstate(chainstate),
connman(_connman),
m_dmnman(dmnman),
Expand Down
4 changes: 3 additions & 1 deletion src/dsnotificationinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ void CDSNotificationInterface::BlockDisconnected(const std::shared_ptr<const CBl
void CDSNotificationInterface::NotifyMasternodeListChanged(bool undo, const CDeterministicMNList& oldMNList, const CDeterministicMNListDiff& diff)
{
CMNAuth::NotifyMasternodeListChanged(undo, oldMNList, diff, m_connman);
m_govman.UpdateCachesAndClean();
if (m_govman.IsValid()) {
m_govman.CheckAndRemove();
}
}

void CDSNotificationInterface::NotifyChainLock(const CBlockIndex* pindex, const std::shared_ptr<const llmq::CChainLockSig>& clsig)
Expand Down
2 changes: 2 additions & 0 deletions src/evo/mnauth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ void CMNAuth::PushMNAUTH(CNode& peer, CConnman& connman, const CBlockIndex* tip)

PeerMsgRet CMNAuth::ProcessMessage(CNode& peer, CConnman& connman, const CDeterministicMNList& tip_mn_list, std::string_view msg_type, CDataStream& vRecv)
{
assert(::mmetaman->IsValid());
Copy link
Collaborator

Choose a reason for hiding this comment

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

what happen if mmetaman is not initialized yet and we will ignore this message? is it fatal?

I feel like this assert is a little bit too much. also if message is not MNAUTH - it's not even need any processing

Copy link
Collaborator Author

@kwvg kwvg Apr 6, 2024

Choose a reason for hiding this comment

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

Database initialization (setting IsValid() to true) is done (source) before networking starts (source). If there is a database problem that didn't get caught earlier on, starting networking threads and read-writing values could result in an inconsistent state. This is a problem regardless of which database and therefore, should fast-fail if it happens.

CMNAuth::ProcessMessage is only called by PeerManagerImpl::ProcessMessages (source), there aren't any other threads or entities that can call it, making a state where peerman exists but mn_metaman doesn't improbable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add doxygen here to require mn_metamann be non nullptr here:

static PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, CMasternodeMetaMan& mn_metaman, const CActiveMasternodeManager* const mn_activeman,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're already passing CMasternodeMetaMan as a reference here, there's no opportunity for it to be a nullptr.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, I mean mn_metaman to be valid due to assert(mn_metaman.IsValid());. That can't be nullptr indeed, but it can be invalid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Resolved in latest push (comment added in header)


if (msg_type != NetMsgType::MNAUTH || !::masternodeSync->IsBlockchainSynced()) {
// we can't verify MNAUTH messages when we don't have the latest MN list
return {};
Expand Down
5 changes: 5 additions & 0 deletions src/evo/mnauth.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ class CMNAuth
}

static void PushMNAUTH(CNode& peer, CConnman& connman, const CBlockIndex* tip);

/**
* @pre CMasternodeMetaMan's database must be successfully loaded before
* attempting to call this function regardless of sync state
*/
static PeerMsgRet ProcessMessage(CNode& peer, CConnman& connman, const CDeterministicMNList& tip_mn_list, std::string_view msg_type, CDataStream& vRecv);
static void NotifyMasternodeListChanged(bool undo, const CDeterministicMNList& oldMNList, const CDeterministicMNListDiff& diff, CConnman& connman);
};
Expand Down
4 changes: 2 additions & 2 deletions src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ static bool CheckSpecialTxInner(CDeterministicMNManager& dmnman, const CTransact
return state.Invalid(TxValidationResult::TX_BAD_SPECIAL, "bad-tx-type-check");
}

bool CheckSpecialTx(CDeterministicMNManager& dmnman, const CTransaction& tx, const CBlockIndex* pindexPrev, const CCoinsViewCache& view, bool check_sigs, TxValidationState& state)
bool CSpecialTxProcessor::CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, const CCoinsViewCache& view, bool check_sigs, TxValidationState& state)
{
AssertLockHeld(cs_main);
return CheckSpecialTxInner(dmnman, tx, pindexPrev, view, std::nullopt, check_sigs, state);
return CheckSpecialTxInner(m_dmnman, tx, pindexPrev, view, std::nullopt, check_sigs, state);
}

[[nodiscard]] bool CSpecialTxProcessor::ProcessSpecialTx(const CTransaction& tx, const CBlockIndex* pindex, TxValidationState& state)
Expand Down
5 changes: 2 additions & 3 deletions src/evo/specialtxman.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ class CChainLocksHandler;

extern RecursiveMutex cs_main;

bool CheckSpecialTx(CDeterministicMNManager& dmnman, const CTransaction& tx, const CBlockIndex* pindexPrev,
const CCoinsViewCache& view, bool check_sigs, TxValidationState& state) EXCLUSIVE_LOCKS_REQUIRED(cs_main);

class CSpecialTxProcessor
{
private:
Expand All @@ -51,6 +48,8 @@ class CSpecialTxProcessor
const Consensus::Params& consensus_params, const llmq::CChainLocksHandler& clhandler) :
m_cpoolman(cpoolman), m_dmnman{dmnman}, m_mnhfman{mnhfman}, m_qblockman{qblockman}, m_consensus_params{consensus_params}, m_clhandler{clhandler} {}

bool CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, const CCoinsViewCache& view, bool check_sigs, TxValidationState& state)
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
bool ProcessSpecialTxsInBlock(const CBlock& block, const CBlockIndex* pindex, const CCoinsViewCache& view, bool fJustCheck,
bool fCheckCbTxMerkleRoots, BlockValidationState& state, std::optional<MNListUpdates>& updatesRet)
EXCLUSIVE_LOCKS_REQUIRED(cs_main);
Expand Down
6 changes: 4 additions & 2 deletions src/governance/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ void CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj, CConnman
GetMainSignals().NotifyGovernanceObject(std::make_shared<const Governance::Object>(govobj.Object()));
}

void CGovernanceManager::UpdateCachesAndClean()
void CGovernanceManager::CheckAndRemove()
{
assert(::mmetaman->IsValid());

// Return on initial sync, spammed the debug.log and provided no use
if (::masternodeSync == nullptr || !::masternodeSync->IsBlockchainSynced()) return;

Expand Down Expand Up @@ -794,7 +796,7 @@ void CGovernanceManager::DoMaintenance(CConnman& connman)
RequestOrphanObjects(connman);

// CHECK AND REMOVE - REPROCESS GOVERNANCE OBJECTS
UpdateCachesAndClean();
CheckAndRemove();
}

bool CGovernanceManager::ConfirmInventoryRequest(const CInv& inv)
Expand Down
4 changes: 1 addition & 3 deletions src/governance/governance.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,7 @@ class CGovernanceManager : public GovernanceStore

void AddGovernanceObject(CGovernanceObject& govobj, CConnman& connman, const CNode* pfrom = nullptr);

void UpdateCachesAndClean();

void CheckAndRemove() { UpdateCachesAndClean(); }
void CheckAndRemove();

UniValue ToJson() const;

Expand Down
4 changes: 3 additions & 1 deletion src/governance/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ CGovernanceObject::CGovernanceObject(const CGovernanceObject& other) :

bool CGovernanceObject::ProcessVote(CGovernanceManager& govman, const CDeterministicMNList& tip_mn_list, const CGovernanceVote& vote, CGovernanceException& exception)
{
assert(::mmetaman->IsValid());

LOCK(cs);

// do not process already known valid votes twice
Expand Down Expand Up @@ -424,7 +426,7 @@ bool CGovernanceObject::IsValidLocally(const CDeterministicMNList& tip_mn_list,
case GovernanceObject::PROPOSAL: {
CProposalValidator validator(GetDataAsHexString());
// Note: It's ok to have expired proposals
// they are going to be cleared by CGovernanceManager::UpdateCachesAndClean()
// they are going to be cleared by CGovernanceManager::CheckAndRemove()
// TODO: should they be tagged as "expired" to skip vote downloading?
if (!validator.Validate(false)) {
strError = strprintf("Invalid proposal data, error messages: %s", validator.GetErrorMessages());
Expand Down
78 changes: 40 additions & 38 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,13 +305,13 @@ void PrepareShutdown(NodeContext& node)

// After all scheduled tasks have been flushed, destroy pointers
// and reset all to nullptr.
node.mn_metaman = nullptr;
::mmetaman.reset();
node.mn_sync = nullptr;
::masternodeSync.reset();
node.sporkman.reset();
node.govman.reset();
node.netfulfilledman.reset();
node.mn_metaman = nullptr;
::mmetaman.reset();

// Stop and delete all indexes only after flushing background callbacks.
if (g_txindex) {
Expand Down Expand Up @@ -1676,6 +1676,10 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
node.chainman = &g_chainman;
ChainstateManager& chainman = *Assert(node.chainman);

assert(!::mmetaman);
::mmetaman = std::make_unique<CMasternodeMetaMan>();
node.mn_metaman = ::mmetaman.get();

assert(!node.netfulfilledman);
node.netfulfilledman = std::make_unique<CNetFulfilledRequestManager>();

Expand Down Expand Up @@ -1713,10 +1717,27 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
::masternodeSync = std::make_unique<CMasternodeSync>(*node.connman, *node.netfulfilledman, *node.govman);
node.mn_sync = ::masternodeSync.get();

fMasternodeMode = false;
std::string strMasterNodeBLSPrivKey = args.GetArg("-masternodeblsprivkey", "");
if (!strMasterNodeBLSPrivKey.empty()) {
CBLSSecretKey keyOperator(ParseHex(strMasterNodeBLSPrivKey));
if (!keyOperator.IsValid()) {
return InitError(_("Invalid masternodeblsprivkey. Please see documentation."));
}
fMasternodeMode = true;
{
// Create and register activeMasternodeManager, will init later in ThreadImport
::activeMasternodeManager = std::make_unique<CActiveMasternodeManager>(keyOperator, *node.connman, ::deterministicMNManager);
node.mn_activeman = ::activeMasternodeManager.get();
RegisterValidationInterface(node.mn_activeman);
}
}

assert(!node.peerman);
node.peerman = PeerManager::make(chainparams, *node.connman, *node.addrman, node.banman.get(),
*node.scheduler, chainman, *node.mempool, *node.govman, *node.sporkman,
::deterministicMNManager, node.cj_ctx, node.llmq_ctx, ignores_incoming_txs);
*node.scheduler, chainman, *node.mempool, *node.mn_metaman, *node.mn_sync,
*node.govman, *node.sporkman, ::deterministicMNManager,
node.cj_ctx, node.llmq_ctx, ignores_incoming_txs);
RegisterValidationInterface(node.peerman.get());

// sanitize comments per BIP-0014, format user agent and check total size
Expand Down Expand Up @@ -1844,22 +1865,6 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
);
RegisterValidationInterface(pdsNotificationInterface);

fMasternodeMode = false;
std::string strMasterNodeBLSPrivKey = args.GetArg("-masternodeblsprivkey", "");
if (!strMasterNodeBLSPrivKey.empty()) {
CBLSSecretKey keyOperator(ParseHex(strMasterNodeBLSPrivKey));
if (!keyOperator.IsValid()) {
return InitError(_("Invalid masternodeblsprivkey. Please see documentation."));
}
fMasternodeMode = true;
{
// Create and register activeMasternodeManager, will init later in ThreadImport
::activeMasternodeManager = std::make_unique<CActiveMasternodeManager>(keyOperator, *node.connman, ::deterministicMNManager);
node.mn_activeman = ::activeMasternodeManager.get();
RegisterValidationInterface(node.mn_activeman);
}
}

// ********************************************************* Step 7a: Load sporks

if (!node.sporkman->LoadCache()) {
Expand Down Expand Up @@ -2211,33 +2216,30 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc

bool fLoadCacheFiles = !(fReindex || fReindexChainState) && (::ChainActive().Tip() != nullptr);

if (!fDisableGovernance) {
if (!node.govman->LoadCache(fLoadCacheFiles)) {
auto file_path = (GetDataDir() / "governance.dat").string();
if (fLoadCacheFiles && !fDisableGovernance) {
return InitError(strprintf(_("Failed to load governance cache from %s"), file_path));
}
return InitError(strprintf(_("Failed to clear governance cache at %s"), file_path));
if (!node.netfulfilledman->LoadCache(fLoadCacheFiles)) {
auto file_path = (GetDataDir() / "netfulfilled.dat").string();
if (fLoadCacheFiles) {
return InitError(strprintf(_("Failed to load fulfilled requests cache from %s"), file_path));
}
return InitError(strprintf(_("Failed to clear fulfilled requests cache at %s"), file_path));
}

assert(!::mmetaman);
::mmetaman = std::make_unique<CMasternodeMetaMan>(fLoadCacheFiles);
node.mn_metaman = ::mmetaman.get();
if (!node.mn_metaman->IsValid()) {
if (!node.mn_metaman->LoadCache(fLoadCacheFiles)) {
auto file_path = (GetDataDir() / "mncache.dat").string();
if (fLoadCacheFiles) {
return InitError(strprintf(_("Failed to load masternode cache from %s"), file_path));
}
return InitError(strprintf(_("Failed to clear masternode cache at %s"), file_path));
}

if (!node.netfulfilledman->LoadCache(fLoadCacheFiles)) {
auto file_path = (GetDataDir() / "netfulfilled.dat").string();
if (fLoadCacheFiles) {
return InitError(strprintf(_("Failed to load fulfilled requests cache from %s"), file_path));
if (!fDisableGovernance) {
if (!node.govman->LoadCache(fLoadCacheFiles)) {
auto file_path = (GetDataDir() / "governance.dat").string();
if (fLoadCacheFiles && !fDisableGovernance) {
return InitError(strprintf(_("Failed to load governance cache from %s"), file_path));
}
return InitError(strprintf(_("Failed to clear governance cache at %s"), file_path));
}
return InitError(strprintf(_("Failed to clear fulfilled requests cache at %s"), file_path));
}

// ********************************************************* Step 8: start indexers
Expand Down Expand Up @@ -2305,7 +2307,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc

node.scheduler->scheduleEvery(std::bind(&CNetFulfilledRequestManager::DoMaintenance, std::ref(*node.netfulfilledman)), std::chrono::minutes{1});
node.scheduler->scheduleEvery(std::bind(&CMasternodeSync::DoMaintenance, std::ref(*node.mn_sync)), std::chrono::seconds{1});
node.scheduler->scheduleEvery(std::bind(&CMasternodeUtils::DoMaintenance, std::ref(*node.connman), std::ref(*node.mn_sync), std::ref(*node.cj_ctx)), std::chrono::minutes{1});
node.scheduler->scheduleEvery(std::bind(&CMasternodeUtils::DoMaintenance, std::ref(*node.connman), std::ref(*node.dmnman), std::ref(*node.mn_sync), std::ref(*node.cj_ctx)), std::chrono::minutes{1});
node.scheduler->scheduleEvery(std::bind(&CDeterministicMNManager::DoMaintenance, std::ref(*node.dmnman)), std::chrono::seconds{10});

if (!fDisableGovernance) {
Expand Down Expand Up @@ -2533,7 +2535,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc

connOptions.m_i2p_accept_incoming = args.GetBoolArg("-i2pacceptincoming", true);

if (!node.connman->Start(*node.scheduler, connOptions)) {
if (!node.connman->Start(*node.dmnman, *node.mn_metaman, *node.mn_sync, *node.scheduler, connOptions)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <masternode/sync.h>

LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool, const CActiveMasternodeManager* mn_activeman,
CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman,
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 Down
2 changes: 1 addition & 1 deletion src/llmq/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct LLMQContext {
LLMQContext() = delete;
LLMQContext(const LLMQContext&) = delete;
LLMQContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool, const CActiveMasternodeManager* mn_activeman,
CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman,
const std::unique_ptr<PeerManager>& peerman, bool unit_tests, bool wipe);
~LLMQContext();

Expand Down
2 changes: 2 additions & 0 deletions src/llmq/dkgsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ void CDKGSession::VerifyAndComplain(CDKGPendingMessages& pendingMessages)

void CDKGSession::VerifyConnectionAndMinProtoVersions() const
{
assert(::mmetaman->IsValid());

if (!IsQuorumPoseEnabled(params.type, m_sporkman)) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/dkgsession.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class CDKGSession
CDeterministicMNManager& m_dmnman;
CDKGSessionManager& dkgManager;
CDKGDebugManager& dkgDebugManager;
const CActiveMasternodeManager* m_mn_activeman;
const CActiveMasternodeManager* const m_mn_activeman;
const CSporkManager& m_sporkman;

const CBlockIndex* m_quorum_base_block_index{nullptr};
Expand Down Expand Up @@ -319,7 +319,7 @@ class CDKGSession
public:
CDKGSession(const Consensus::LLMQParams& _params, CBLSWorker& _blsWorker, CDeterministicMNManager& dmnman,
CDKGSessionManager& _dkgManager, CDKGDebugManager& _dkgDebugManager, CConnman& _connman,
const CActiveMasternodeManager* mn_activeman, const CSporkManager& sporkman) :
const CActiveMasternodeManager* const mn_activeman, const CSporkManager& sporkman) :
params(_params), blsWorker(_blsWorker), cache(_blsWorker), m_dmnman(dmnman), dkgManager(_dkgManager),
dkgDebugManager(_dkgDebugManager), m_mn_activeman(mn_activeman), m_sporkman(sporkman), connman(_connman) {}

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/dkgsessionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace llmq

CDKGSessionHandler::CDKGSessionHandler(CBLSWorker& _blsWorker, CChainState& chainstate, CConnman& _connman, CDeterministicMNManager& dmnman,
CDKGDebugManager& _dkgDebugManager, CDKGSessionManager& _dkgManager, CQuorumBlockProcessor& _quorumBlockProcessor,
const CActiveMasternodeManager* mn_activeman, const CSporkManager& sporkman, const Consensus::LLMQParams& _params,
const CActiveMasternodeManager* const mn_activeman, const CSporkManager& sporkman, const Consensus::LLMQParams& _params,
int _quorumIndex) :
blsWorker(_blsWorker),
m_chainstate(chainstate),
Expand Down
Loading