-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: reset chainman to allow reindex on failure #5405
Conversation
@@ -2022,6 +2022,8 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc | |||
LOCK(cs_main); | |||
node.evodb.reset(); | |||
node.evodb = std::make_unique<CEvoDB>(nEvoDbCache, false, fReset || fReindexChainState); | |||
|
|||
chainman.Reset(); |
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.
why don't reset pointer also to be sure that all destructors will be called too?
p.s. seems are Reset() already does everything properly and likely it would be like that in future, so, that's sufficient enough.... Just think like using RAII [when possible] is better because no hidden non-reinizialized data remains.
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
This pull request has conflicts, please rebase. |
current develop fails with `should not be overwriting a chainstate`
071a732
to
820de6c
Compare
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 for squash merge
current develop fails to reindex whenever there is an issue at node start (prints `should not be overwriting a chainstate` in `debug.log`) reset chainman to allow it re-initialize chainstate simulated an issue with ``` if (!fReset) { strLoadError = _("DEBUG"); break; } ``` should not be any but pls test - [x] 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 - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_
Issue being fixed or feature implemented
current develop fails to reindex whenever there is an issue at node start (prints
should not be overwriting a chainstate
indebug.log
)What was done?
reset chainman to allow it re-initialize chainstate
How Has This Been Tested?
simulated an issue with
Breaking Changes
should not be any but pls test
Checklist: