mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Use llmqDb for CRecoveredSigsDb
Instead of creating its own CDBWrapper internally.
This commit is contained in:
parent
b2cd1db406
commit
61e10f6512
@ -33,7 +33,7 @@ void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests)
|
||||
quorumDKGSessionManager = new CDKGSessionManager(*llmqDb, blsWorker);
|
||||
quorumManager = new CQuorumManager(evoDb, blsWorker, *quorumDKGSessionManager);
|
||||
quorumSigSharesManager = new CSigSharesManager();
|
||||
quorumSigningManager = new CSigningManager(unitTests);
|
||||
quorumSigningManager = new CSigningManager(*llmqDb, unitTests);
|
||||
chainLocksHandler = new CChainLocksHandler(scheduler);
|
||||
quorumInstantSendManager = new CInstantSendManager(scheduler);
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ namespace llmq
|
||||
|
||||
CSigningManager* quorumSigningManager;
|
||||
|
||||
CRecoveredSigsDb::CRecoveredSigsDb(bool fMemory) :
|
||||
db(fMemory ? "" : (GetDataDir() / "llmq"), 1 << 20, fMemory)
|
||||
CRecoveredSigsDb::CRecoveredSigsDb(CDBWrapper& _db) :
|
||||
db(_db)
|
||||
{
|
||||
}
|
||||
|
||||
@ -290,8 +290,8 @@ void CRecoveredSigsDb::WriteVoteForId(Consensus::LLMQType llmqType, const uint25
|
||||
|
||||
//////////////////
|
||||
|
||||
CSigningManager::CSigningManager(bool fMemory) :
|
||||
db(fMemory)
|
||||
CSigningManager::CSigningManager(CDBWrapper& llmqDb, bool fMemory) :
|
||||
db(llmqDb)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ class CRecoveredSigsDb
|
||||
static const size_t MAX_CACHE_TRUNCATE_THRESHOLD = 50000;
|
||||
|
||||
private:
|
||||
CDBWrapper db;
|
||||
CDBWrapper& db;
|
||||
|
||||
CCriticalSection cs;
|
||||
std::unordered_map<std::pair<Consensus::LLMQType, uint256>, std::pair<bool, int64_t>, StaticSaltedHasher> hasSigForIdCache;
|
||||
@ -80,7 +80,7 @@ private:
|
||||
std::unordered_map<uint256, std::pair<bool, int64_t>, StaticSaltedHasher> hasSigForHashCache;
|
||||
|
||||
public:
|
||||
CRecoveredSigsDb(bool fMemory);
|
||||
CRecoveredSigsDb(CDBWrapper& _db);
|
||||
|
||||
bool HasRecoveredSig(Consensus::LLMQType llmqType, const uint256& id, const uint256& msgHash);
|
||||
bool HasRecoveredSigForId(Consensus::LLMQType llmqType, const uint256& id);
|
||||
@ -136,7 +136,7 @@ private:
|
||||
std::vector<CRecoveredSigsListener*> recoveredSigsListeners;
|
||||
|
||||
public:
|
||||
CSigningManager(bool fMemory);
|
||||
CSigningManager(CDBWrapper& llmqDb, bool fMemory);
|
||||
|
||||
bool AlreadyHave(const CInv& inv);
|
||||
bool GetRecoveredSigForGetData(const uint256& hash, CRecoveredSig& ret);
|
||||
|
Loading…
Reference in New Issue
Block a user