2023-12-31 01:00:00 +01:00
|
|
|
// Copyright (c) 2018-2023 The Dash Core developers
|
2022-11-07 19:09:44 +01:00
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_LLMQ_CONTEXT_H
|
|
|
|
#define BITCOIN_LLMQ_CONTEXT_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
class CBLSWorker;
|
2023-08-23 19:11:26 +02:00
|
|
|
class CChainState;
|
2022-11-07 19:09:44 +01:00
|
|
|
class CConnman;
|
2024-03-15 13:17:42 +01:00
|
|
|
class CDeterministicMNManager;
|
2022-11-07 19:09:44 +01:00
|
|
|
class CDBWrapper;
|
|
|
|
class CEvoDB;
|
2024-02-29 15:52:08 +01:00
|
|
|
class CMNHFManager;
|
2022-11-07 19:09:44 +01:00
|
|
|
class CSporkManager;
|
2023-10-18 05:31:40 +02:00
|
|
|
class CTxMemPool;
|
2023-04-28 07:17:42 +02:00
|
|
|
class PeerManager;
|
2022-11-07 19:09:44 +01:00
|
|
|
|
|
|
|
namespace llmq {
|
2023-10-18 05:31:40 +02:00
|
|
|
class CChainLocksHandler;
|
2022-11-07 19:09:44 +01:00
|
|
|
class CDKGDebugManager;
|
|
|
|
class CDKGSessionManager;
|
2023-10-18 05:31:40 +02:00
|
|
|
class CEHFSignalsHandler;
|
|
|
|
class CInstantSendManager;
|
|
|
|
class CQuorumBlockProcessor;
|
2022-11-07 19:09:44 +01:00
|
|
|
class CQuorumManager;
|
|
|
|
class CSigSharesManager;
|
|
|
|
class CSigningManager;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct LLMQContext {
|
2023-07-30 03:23:02 +02:00
|
|
|
LLMQContext() = delete;
|
|
|
|
LLMQContext(const LLMQContext&) = delete;
|
2024-03-15 13:17:42 +01:00
|
|
|
LLMQContext(CChainState& chainstate, CConnman& connman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
|
|
|
|
CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool,
|
2023-04-28 07:17:42 +02:00
|
|
|
const std::unique_ptr<PeerManager>& peerman, bool unit_tests, bool wipe);
|
2022-11-07 19:09:44 +01:00
|
|
|
~LLMQContext();
|
|
|
|
|
|
|
|
void Interrupt();
|
|
|
|
void Start();
|
|
|
|
void Stop();
|
|
|
|
|
2023-07-30 03:23:02 +02:00
|
|
|
/** Guaranteed if LLMQContext is initialized then all members are valid too
|
|
|
|
*
|
|
|
|
* Please note, that members here should not be re-ordered, because initialization
|
|
|
|
* some of them requires other member initialized.
|
|
|
|
* For example, constructor `quorumManager` requires `bls_worker`.
|
|
|
|
*
|
|
|
|
* Some objects are still global variables and their de-globalization is not trivial
|
|
|
|
* at this point. LLMQContext keeps just a pointer to them and doesn't own these objects,
|
|
|
|
* but it still guarantees that objects are created and valid
|
|
|
|
*/
|
|
|
|
const std::shared_ptr<CBLSWorker> bls_worker;
|
|
|
|
const std::unique_ptr<llmq::CDKGDebugManager> dkg_debugman;
|
|
|
|
llmq::CQuorumBlockProcessor* const quorum_block_processor;
|
|
|
|
const std::unique_ptr<llmq::CDKGSessionManager> qdkgsman;
|
|
|
|
llmq::CQuorumManager* const qman;
|
|
|
|
const std::unique_ptr<llmq::CSigningManager> sigman;
|
|
|
|
const std::unique_ptr<llmq::CSigSharesManager> shareman;
|
|
|
|
llmq::CChainLocksHandler* const clhandler;
|
|
|
|
llmq::CInstantSendManager* const isman;
|
2023-10-18 05:31:40 +02:00
|
|
|
const std::unique_ptr<llmq::CEHFSignalsHandler> ehfSignalsHandler;
|
2022-11-07 19:09:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BITCOIN_LLMQ_CONTEXT_H
|