Resolve the checkpoints <-> validation circular dependency#15655
Merged
maflcko merged 1 commit intobitcoin:masterfrom Apr 19, 2019
Merged
Resolve the checkpoints <-> validation circular dependency#15655maflcko merged 1 commit intobitcoin:masterfrom
maflcko merged 1 commit intobitcoin:masterfrom
Conversation
This commit resolves the checkpoints -> validation -> checkpoints cirular dependency by moving `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` from `checkpoints.cpp` to `validation.cpp`.
Contributor
|
Concept ACK |
Contributor
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Contributor
|
utACK 418d323, only |
skwp
reviewed
Mar 23, 2019
Contributor
|
utACK 418d323 Very nice to get rid of yet another circular dependency! Thanks! |
Member
|
utACK 418d323 The checkpoint-data has long been moved to chainparams, so not worth to keep two files for a single function at this point. |
Member
|
utACK 418d323 |
maflcko
pushed a commit
that referenced
this pull request
Apr 19, 2019
418d323 Resolve the checkpoints <-> validation CD. (251) Pull request description: This pull request attempts to resolve the `checkpoints -> validation -> checkpoints` circular dependency. The circular dependency is resolved by moving the `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` function to `validation.cpp` where it used exclusively by the private function `ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)`. ACKs for commit 418d32: promag: utACK 418d323, only `GetLastCheckpoint` usage is in `validation.cpp` and so makes sense to move it there. practicalswift: utACK 418d323 MarcoFalke: utACK 418d323 sipa: utACK 418d323 Tree-SHA512: 03c3556bc192e65f5e3fa76fd545d4ee7d63d3fb06b132f7a1fa6131aa21ddd2e5b2d19e2222dfe524f422daaca30efde219bed188db8c74ff4b088876b5bc16
jasonbcox
pushed a commit
to Bitcoin-ABC/bitcoin-abc
that referenced
this pull request
Sep 22, 2020
Summary: in lieu of ::BlockIndex(). bitcoin/bitcoin@682a1d0 --- Depends on D6968 Concludes backport of Core [[bitcoin/bitcoin#16194 | PR16194]] Notes: This backport originally changes LookupBlockIndex from being defined inline in validation.h to declared there and defined in validation.cpp. Since we have that function defined in chain.h, I have chosen to defer to the change in the backport to stick closer to Core. That has the unfortunate side effect of bringing back the checkpoints -> validation -> checkpoints circular dependency, that I plan on resolving by backporting Core [[bitcoin/bitcoin#15655 | PR15655]], if this diff is landed as is. Test Plan: ninja check-all --extended Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D6970
PastaPastaPasta
pushed a commit
to PastaPastaPasta/dash
that referenced
this pull request
Oct 25, 2021
…dependency 418d323 Resolve the checkpoints <-> validation CD. (251) Pull request description: This pull request attempts to resolve the `checkpoints -> validation -> checkpoints` circular dependency. The circular dependency is resolved by moving the `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` function to `validation.cpp` where it used exclusively by the private function `ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)`. ACKs for commit 418d32: promag: utACK 418d323, only `GetLastCheckpoint` usage is in `validation.cpp` and so makes sense to move it there. practicalswift: utACK 418d323 MarcoFalke: utACK 418d323 sipa: utACK 418d323 Tree-SHA512: 03c3556bc192e65f5e3fa76fd545d4ee7d63d3fb06b132f7a1fa6131aa21ddd2e5b2d19e2222dfe524f422daaca30efde219bed188db8c74ff4b088876b5bc16
pravblockc
pushed a commit
to pravblockc/dash
that referenced
this pull request
Nov 18, 2021
…dependency 418d323 Resolve the checkpoints <-> validation CD. (251) Pull request description: This pull request attempts to resolve the `checkpoints -> validation -> checkpoints` circular dependency. The circular dependency is resolved by moving the `CheckPoints::GetLastCheckpoint(const CCheckpointData& data)` function to `validation.cpp` where it used exclusively by the private function `ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime)`. ACKs for commit 418d32: promag: utACK 418d323, only `GetLastCheckpoint` usage is in `validation.cpp` and so makes sense to move it there. practicalswift: utACK 418d323 MarcoFalke: utACK 418d323 sipa: utACK 418d323 Tree-SHA512: 03c3556bc192e65f5e3fa76fd545d4ee7d63d3fb06b132f7a1fa6131aa21ddd2e5b2d19e2222dfe524f422daaca30efde219bed188db8c74ff4b088876b5bc16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request attempts to resolve the
checkpoints -> validation -> checkpointscircular dependency.The circular dependency is resolved by moving the
CheckPoints::GetLastCheckpoint(const CCheckpointData& data)function tovalidation.cppwhere it used exclusively by the private functionContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, const CChainParams& params, const CBlockIndex* pindexPrev, int64_t nAdjustedTime).