Skip to content

Commit bfca726

Browse files
committed
perf: do not create mini-snapshots during re-index
1 parent 38513b6 commit bfca726

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/evo/deterministicmns.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <consensus/validation.h>
1717
#include <deploymentstatus.h>
1818
#include <messagesigner.h>
19+
#include <node/blockstorage.h>
1920
#include <script/standard.h>
2021
#include <stats/client.h>
2122
#include <uint256.h>
@@ -778,7 +779,7 @@ CDeterministicMNList CDeterministicMNManager::GetListForBlockInternal(gsl::not_n
778779
for (const auto& diffIndex : listDiffIndexes) {
779780
const auto& diff = mnListDiffsCache.at(diffIndex->GetBlockHash());
780781
snapshot.ApplyDiff(diffIndex, diff);
781-
if (snapshot.GetHeight() % 32 == 0) {
782+
if (!fReindex && snapshot.GetHeight() % 32 == 0) {
782783
// Add this temporary mini-snapshot to cache.
783784
// This extra cached mn-list helps to improve performance of GetListForBlock
784785
// for close blocks, because in the worst cases each of them requires to retrieve

0 commit comments

Comments
 (0)