We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 690a1cd commit 38513b6Copy full SHA for 38513b6
src/evo/deterministicmns.cpp
@@ -778,6 +778,13 @@ CDeterministicMNList CDeterministicMNManager::GetListForBlockInternal(gsl::not_n
778
for (const auto& diffIndex : listDiffIndexes) {
779
const auto& diff = mnListDiffsCache.at(diffIndex->GetBlockHash());
780
snapshot.ApplyDiff(diffIndex, diff);
781
+ if (snapshot.GetHeight() % 32 == 0) {
782
+ // Add this temporary mini-snapshot to cache.
783
+ // This extra cached mn-list helps to improve performance of GetListForBlock
784
+ // for close blocks, because in the worst cases each of them requires to retrieve
785
+ // and apply up to 575 diffs
786
+ mnListsCache.emplace(snapshot.GetBlockHash(), snapshot);
787
+ }
788
}
789
790
if (tipIndex) {
0 commit comments