bitcoin#22762 (backported as part of dash#6043) did away with then-existing behaviour of overwriting peers.dat silently if found corrupt with the rationale of preventing situations where the wrong file is pointed at or the file is written by a higher version of Core. Alongside a change in behaviour, refactoring also took place and further changes were built on top of them.
Since then, there have been reports of an increasing number of "Corrupt data. Consistency check failed with code -5: iostream error" errors from builds based on develop. Reverting the pull request that introduced this change in behaviour is non-trivial due to the number of backports that build on top of the refactoring brought along with it.
Nor were any other error messages found except for the one mentioned above. The tendency for peers.dat to corrupt itself has also been documented upstream (bitcoin#26599), with the issue marked as closed with the merger of bitcoin#26909.
Therefore, to remedy the above problem, alongside backporting bitcoin#26909, to avoid inconvenience, instead of reverting all progress made from backporting (as the benefits of not overwriting peers.dat for having the wrong magic altogether, for example, is something that doesn't need to be reverted), only inconsistent peers.dat files will be overwritten and the action logged with no user intervention required.
Breaking Changes
None expected.
Checklist:
[x] I have performed a self-review of my own code
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have added or updated relevant unit/integration/functional/e2e tests
[x] I have made corresponding changes to the documentation (note: N/A)
[x] I have assigned this pull request to a milestone (for repository code-owners and collaborators only)
Additional Information
bitcoin#22762 (backported as part of dash#6043) did away with then-existing behaviour of overwriting
peers.dat
silently if found corrupt with the rationale of preventing situations where the wrong file is pointed at or the file is written by a higher version of Core. Alongside a change in behaviour, refactoring also took place and further changes were built on top of them.Since then, there have been reports of an increasing number of "Corrupt data. Consistency check failed with code -5: iostream error" errors from builds based on
develop
. Reverting the pull request that introduced this change in behaviour is non-trivial due to the number of backports that build on top of the refactoring brought along with it.Nor were any other error messages found except for the one mentioned above. The tendency for
peers.dat
to corrupt itself has also been documented upstream (bitcoin#26599), with the issue marked as closed with the merger of bitcoin#26909.Therefore, to remedy the above problem, alongside backporting bitcoin#26909, to avoid inconvenience, instead of reverting all progress made from backporting (as the benefits of not overwriting
peers.dat
for having the wrong magic altogether, for example, is something that doesn't need to be reverted), only inconsistentpeers.dat
files will be overwritten and the action logged with no user intervention required.Breaking Changes
None expected.
Checklist: