-
Notifications
You must be signed in to change notification settings - Fork 38.7k
refactor: move CCoinsViewErrorCatcher out of init.cpp #16355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
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. |
maflcko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK, just some dumb style nits and an erroneous include, I think. Feel free to ignore the nits.
afe7aff to
99ccdef
Compare
|
Took @MarcoFalke's patch and rebased. Thanks, Marco. |
99ccdef to
30de23d
Compare
|
Had to revert part of Marco's patch (see #16355 (comment)). |
|
ACK 30de23d, mostly move-only moving CCoinsViewErrorCatcher out of init makes sense, so that e.g. a chainstate Show signature and timestampSignature: Timestamp of file with hash |
|
ACK 30de23d Code changes make sense and I tested locally. |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 30de23d. Simple change. I verified the appropriate parts are move-only with -w --color-moved=dimmed_zebra.
src/coins.h
Outdated
| public: | ||
| explicit CCoinsViewErrorCatcher(CCoinsView* view) : CCoinsViewBacked(view) {} | ||
|
|
||
| void AddReadErrCallback(const std::function<void()> f) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should drop const, otherwise std::move below can't really have any effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, thanks!
|
utACK. Could you fix up Rus's nit and this should be mergeable. |
and into coins.cpp. This move is necessary so that we can later include a CCoinsViewErrorCatcher instance under CChainState. Co-authored-by: MarcoFalke <falke.marco@gmail.com>
30de23d to
4f050b9
Compare
|
Thanks for the reviews and nudge. Pushed. |
|
re-ACK 4f050b9 |
ryanofsky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 4f050b9. Only change since last review is fixing const.
4f050b9 move-onlyish: move CCoinsViewErrorCatcher out of init.cpp (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11): Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal --- This change moves `CCoinsViewErrorCatcher` out of `init` and into `coins` so that it can later be included in [a `CoinsView` instance](9128496#diff-349fbb003d5ae550a2e8fa658e475880R504) under `CChainState`. Instead of hardcoding read failure behavior that has knowledge of qt, it accepts error callbacks via `AddReadErrCallback()`. ACKs for top commit: dongcarl: re-ACK 4f050b9 ryanofsky: utACK 4f050b9. Only change since last review is fixing const. Tree-SHA512: eaba21606d15d2b8d0e3db7cec57779ce181af953db1ef4af80a0bc1dfb57923d0befde9d61b7be55c32224744f7fb6bd47d4e4c72f3ccfe6eaf0f4ae3765c17
Summary: 4f050b91c706181084b9288b8a87b7b637e4e4f7 move-onlyish: move CCoinsViewErrorCatcher out of init.cpp (James O'Beirne) Pull request description: This is part of the [assumeutxo project](https://github.com/bitcoin/bitcoin/projects/11): Parent PR: #15606 Issue: #15605 Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal --- This change moves `CCoinsViewErrorCatcher` out of `init` and into `coins` so that it can later be included in [a `CoinsView` instance](bitcoin/bitcoin@9128496#diff-349fbb003d5ae550a2e8fa658e475880R504) under `CChainState`. Instead of hardcoding read failure behavior that has knowledge of qt, it accepts error callbacks via `AddReadErrCallback()`. ACKs for top commit: dongcarl: re-ACK 4f050b91c706181084b9288b8a87b7b637e4e4f7 ryanofsky: utACK 4f050b91c706181084b9288b8a87b7b637e4e4f7. Only change since last review is fixing const. Tree-SHA512: eaba21606d15d2b8d0e3db7cec57779ce181af953db1ef4af80a0bc1dfb57923d0befde9d61b7be55c32224744f7fb6bd47d4e4c72f3ccfe6eaf0f4ae3765c17 Backport of Core [[bitcoin/bitcoin#16355 | PR16355]] Test Plan: ninja ninja check-all src/bitcoind Verify normal start-up and operation. Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D6634
This is part of the assumeutxo project:
Parent PR: #15606
Issue: #15605
Specification: https://github.com/jamesob/assumeutxo-docs/tree/2019-04-proposal/proposal
This change moves
CCoinsViewErrorCatcherout ofinitand intocoinsso that it can later be included in aCoinsViewinstance underCChainState.Instead of hardcoding read failure behavior that has knowledge of qt, it accepts error callbacks via
AddReadErrCallback().