Line data Source code
1 : // Copyright (c) 2018-2026 The Dash Core developers 2 : // Distributed under the MIT/X11 software license, see the accompanying 3 : // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 : 5 : #include <llmq/context.h> 6 : 7 : #include <bls/bls_worker.h> 8 : #include <instantsend/instantsend.h> 9 : #include <llmq/blockprocessor.h> 10 : #include <llmq/quorumsman.h> 11 : #include <llmq/signing.h> 12 : #include <llmq/snapshot.h> 13 : #include <validation.h> 14 : 15 6126 : LLMQContext::LLMQContext(CDeterministicMNManager& dmnman, CEvoDB& evo_db, CSporkManager& sporkman, 16 : ChainstateManager& chainman, const util::DbWrapperParams& db_params, int8_t bls_threads, 17 : int16_t worker_count, int64_t max_recsigs_age) : 18 3063 : bls_worker{std::make_shared<CBLSWorker>()}, 19 3063 : qsnapman{std::make_unique<llmq::CQuorumSnapshotManager>(evo_db)}, 20 3063 : quorum_block_processor{std::make_unique<llmq::CQuorumBlockProcessor>(chainman.ActiveChainstate(), dmnman, evo_db, 21 3063 : *qsnapman, bls_threads)}, 22 6126 : qman{std::make_unique<llmq::CQuorumManager>(*bls_worker, dmnman, evo_db, *quorum_block_processor, *qsnapman, 23 3063 : chainman, db_params)}, 24 3063 : sigman{std::make_unique<llmq::CSigningManager>(*qman, db_params, max_recsigs_age)}, 25 3063 : isman{std::make_unique<llmq::CInstantSendManager>(sporkman, db_params)} 26 3063 : { 27 : // Have to start it early to let VerifyDB check ChainLock signatures in coinbase 28 3063 : bls_worker->Start(worker_count); 29 6126 : } 30 : 31 6126 : LLMQContext::~LLMQContext() 32 3063 : { 33 3063 : bls_worker->Stop(); 34 6126 : }