Skip to content

Commit

Permalink
Merge #6527: fix: avoid extra work in GetListForBlockInternal before …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
PastaPastaPasta committed Jan 16, 2025
2 parents 7bdf802 + 82684ea commit 80cd18e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,8 +1018,14 @@ void CDeterministicMNManager::HandleQuorumCommitment(const llmq::CFinalCommitmen

CDeterministicMNList CDeterministicMNManager::GetListForBlockInternal(gsl::not_null<const CBlockIndex*> pindex)
{
AssertLockHeld(cs);
CDeterministicMNList snapshot;

if (!DeploymentActiveAt(*pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003)) {
return snapshot;
}

AssertLockHeld(cs);

std::list<const CBlockIndex*> listDiffIndexes;

while (true) {
Expand Down

0 comments on commit 80cd18e

Please sign in to comment.