Skip to content

Commit c6bb9a5

Browse files
committed
perf: re-use evo data about signals between v20 and mn_rr as non-corrupted
1 parent 7a7c9f1 commit c6bb9a5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/evo/mnhftx.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <vector>
2424

2525
static const std::string MNEHF_REQUESTID_PREFIX = "mnhf";
26+
static const std::string DB_SIGNALS = "mnhf";
2627
static const std::string DB_SIGNALS_v2 = "mnhf_s2";
2728

2829
uint256 MNHFTxPayload::GetRequestId() const
@@ -334,6 +335,14 @@ std::optional<CMNHFManager::Signals> CMNHFManager::GetFromCache(const CBlockInde
334335
mnhfCache.insert(blockHash, signals);
335336
return signals;
336337
}
338+
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_MN_RR)) {
339+
// before mn_rr activation we are safe
340+
if (m_evoDb.Read(std::make_pair(DB_SIGNALS, blockHash), signals)) {
341+
LOCK(cs_cache);
342+
mnhfCache.insert(blockHash, signals);
343+
return signals;
344+
}
345+
}
337346
return std::nullopt;
338347
}
339348

0 commit comments

Comments
 (0)