Don't pass CEvoDB to CDKGSessionHandler and CDKGSession

Was never used.
This commit is contained in:
Alexander Block 2019-03-08 17:25:42 +01:00
parent 64ae91268a
commit acb52f6ec1
4 changed files with 7 additions and 11 deletions

View File

@ -13,7 +13,6 @@
#include "bls/bls_worker.h"
#include "evo/deterministicmns.h"
#include "evo/evodb.h"
#include "llmq/quorums_utils.h"
@ -246,7 +245,6 @@ class CDKGSession
private:
const Consensus::LLMQParams& params;
CEvoDB& evoDb;
CBLSWorker& blsWorker;
CBLSWorkerCache cache;
CDKGSessionManager& dkgManager;
@ -287,8 +285,8 @@ private:
std::set<uint256> validCommitments;
public:
CDKGSession(const Consensus::LLMQParams& _params, CEvoDB& _evoDb, CBLSWorker& _blsWorker, CDKGSessionManager& _dkgManager) :
params(_params), evoDb(_evoDb), blsWorker(_blsWorker), cache(_blsWorker), dkgManager(_dkgManager) {}
CDKGSession(const Consensus::LLMQParams& _params, CBLSWorker& _blsWorker, CDKGSessionManager& _dkgManager) :
params(_params), blsWorker(_blsWorker), cache(_blsWorker), dkgManager(_dkgManager) {}
bool Init(int _height, const uint256& _quorumHash, const std::vector<CDeterministicMNCPtr>& mns, const uint256& _myProTxHash);

View File

@ -83,13 +83,12 @@ void CDKGPendingMessages::Clear()
//////
CDKGSessionHandler::CDKGSessionHandler(const Consensus::LLMQParams& _params, CEvoDB& _evoDb, ctpl::thread_pool& _messageHandlerPool, CBLSWorker& _blsWorker, CDKGSessionManager& _dkgManager) :
CDKGSessionHandler::CDKGSessionHandler(const Consensus::LLMQParams& _params, ctpl::thread_pool& _messageHandlerPool, CBLSWorker& _blsWorker, CDKGSessionManager& _dkgManager) :
params(_params),
evoDb(_evoDb),
messageHandlerPool(_messageHandlerPool),
blsWorker(_blsWorker),
dkgManager(_dkgManager),
curSession(std::make_shared<CDKGSession>(_params, _evoDb, _blsWorker, _dkgManager)),
curSession(std::make_shared<CDKGSession>(_params, _blsWorker, _dkgManager)),
pendingContributions((size_t)_params.size * 2), // we allow size*2 messages as we need to make sure we see bad behavior (double messages)
pendingComplaints((size_t)_params.size * 2),
pendingJustifications((size_t)_params.size * 2),
@ -146,7 +145,7 @@ bool CDKGSessionHandler::InitNewQuorum(int newQuorumHeight, const uint256& newQu
const auto& consensus = Params().GetConsensus();
curSession = std::make_shared<CDKGSession>(params, evoDb, blsWorker, dkgManager);
curSession = std::make_shared<CDKGSession>(params, blsWorker, dkgManager);
if (!deterministicMNManager->IsDIP3Enforced(newQuorumHeight)) {
return false;

View File

@ -102,7 +102,6 @@ private:
std::atomic<bool> stopRequested{false};
const Consensus::LLMQParams& params;
CEvoDB& evoDb;
ctpl::thread_pool& messageHandlerPool;
CBLSWorker& blsWorker;
CDKGSessionManager& dkgManager;
@ -119,7 +118,7 @@ private:
CDKGPendingMessages pendingPrematureCommitments;
public:
CDKGSessionHandler(const Consensus::LLMQParams& _params, CEvoDB& _evoDb, ctpl::thread_pool& _messageHandlerPool, CBLSWorker& blsWorker, CDKGSessionManager& _dkgManager);
CDKGSessionHandler(const Consensus::LLMQParams& _params, ctpl::thread_pool& _messageHandlerPool, CBLSWorker& blsWorker, CDKGSessionManager& _dkgManager);
~CDKGSessionHandler();
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);

View File

@ -36,7 +36,7 @@ void CDKGSessionManager::StartMessageHandlerPool()
for (const auto& qt : Params().GetConsensus().llmqs) {
dkgSessionHandlers.emplace(std::piecewise_construct,
std::forward_as_tuple(qt.first),
std::forward_as_tuple(qt.second, evoDb, messageHandlerPool, blsWorker, *this));
std::forward_as_tuple(qt.second, messageHandlerPool, blsWorker, *this));
}
messageHandlerPool.resize(2);