forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext.cpp
More file actions
36 lines (32 loc) · 1.77 KB
/
context.cpp
File metadata and controls
36 lines (32 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2018-2026 The Dash Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <llmq/context.h>
#include <bls/bls_worker.h>
#include <instantsend/instantsend.h>
#include <llmq/blockprocessor.h>
#include <llmq/quorumsman.h>
#include <llmq/signing.h>
#include <llmq/snapshot.h>
#include <validation.h>
LLMQContext::LLMQContext(CDeterministicMNManager& dmnman, CEvoDB& evo_db, CSporkManager& sporkman,
chainlock::Chainlocks& chainlocks, CTxMemPool& mempool, ChainstateManager& chainman,
const CMasternodeSync& mn_sync, const util::DbWrapperParams& db_params, int8_t bls_threads,
int16_t worker_count, int64_t max_recsigs_age) :
bls_worker{std::make_shared<CBLSWorker>()},
qsnapman{std::make_unique<llmq::CQuorumSnapshotManager>(evo_db)},
quorum_block_processor{std::make_unique<llmq::CQuorumBlockProcessor>(chainman.ActiveChainstate(), dmnman, evo_db,
*qsnapman, bls_threads)},
qman{std::make_unique<llmq::CQuorumManager>(*bls_worker, dmnman, evo_db, *quorum_block_processor, *qsnapman,
chainman, db_params)},
sigman{std::make_unique<llmq::CSigningManager>(*qman, db_params, max_recsigs_age)},
isman{std::make_unique<llmq::CInstantSendManager>(chainlocks, chainman.ActiveChainstate(), *sigman, sporkman,
mempool, mn_sync, db_params)}
{
// Have to start it early to let VerifyDB check ChainLock signatures in coinbase
bls_worker->Start(worker_count);
}
LLMQContext::~LLMQContext()
{
bls_worker->Stop();
}