Skip to content

Commit 80cd18e

Browse files
Merge #6527: fix: avoid extra work in GetListForBlockInternal before dip0003 activation
82684ea fix: avoid extra work in GetListForBlockInternal before dip0003 activation (UdjinM6) Pull request description: ## Issue being fixed or feature implemented There could be no DMN before DIP0003, so let's bail out early. The result is less evodb reads and no `initial snapshot` spam in logs when syncing from scratch. ## What was done? ## How Has This Been Tested? ## Breaking Changes n/a ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 82684ea Tree-SHA512: 285c8df682af026593f81402340bfe2376c69b1b77d69c7324a4769a128e5ba62041d59fb0d32cc6fdd51048851127b632aab42bf0645f94b162cfad0dbfb316
2 parents 7bdf802 + 82684ea commit 80cd18e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/evo/deterministicmns.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,8 +1018,14 @@ void CDeterministicMNManager::HandleQuorumCommitment(const llmq::CFinalCommitmen
10181018

10191019
CDeterministicMNList CDeterministicMNManager::GetListForBlockInternal(gsl::not_null<const CBlockIndex*> pindex)
10201020
{
1021-
AssertLockHeld(cs);
10221021
CDeterministicMNList snapshot;
1022+
1023+
if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
1024+
return snapshot;
1025+
}
1026+
1027+
AssertLockHeld(cs);
1028+
10231029
std::list<const CBlockIndex*> listDiffIndexes;
10241030

10251031
while (true) {

0 commit comments

Comments
 (0)