mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 19:42:46 +01:00
perf: re-use evo data about signals between v20 and mn_rr as non-corrupted
This commit is contained in:
parent
7a7c9f12a4
commit
c6bb9a5685
@ -23,6 +23,7 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
static const std::string MNEHF_REQUESTID_PREFIX = "mnhf";
|
static const std::string MNEHF_REQUESTID_PREFIX = "mnhf";
|
||||||
|
static const std::string DB_SIGNALS = "mnhf";
|
||||||
static const std::string DB_SIGNALS_v2 = "mnhf_s2";
|
static const std::string DB_SIGNALS_v2 = "mnhf_s2";
|
||||||
|
|
||||||
uint256 MNHFTxPayload::GetRequestId() const
|
uint256 MNHFTxPayload::GetRequestId() const
|
||||||
@ -334,6 +335,14 @@ std::optional<CMNHFManager::Signals> CMNHFManager::GetFromCache(const CBlockInde
|
|||||||
mnhfCache.insert(blockHash, signals);
|
mnhfCache.insert(blockHash, signals);
|
||||||
return signals;
|
return signals;
|
||||||
}
|
}
|
||||||
|
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_MN_RR)) {
|
||||||
|
// before mn_rr activation we are safe
|
||||||
|
if (m_evoDb.Read(std::make_pair(DB_SIGNALS, blockHash), signals)) {
|
||||||
|
LOCK(cs_cache);
|
||||||
|
mnhfCache.insert(blockHash, signals);
|
||||||
|
return signals;
|
||||||
|
}
|
||||||
|
}
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user