Skip to content
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

Avoid InitError when downgrading peers.dat #24188

Closed
maflcko opened this issue Jan 28, 2022 · 1 comment · Fixed by #24201
Closed

Avoid InitError when downgrading peers.dat #24188

maflcko opened this issue Jan 28, 2022 · 1 comment · Fixed by #24201

Comments

@maflcko
Copy link
Member

maflcko commented Jan 28, 2022

See #22762 (comment)

This can be fixed by creating a new exception type and catching it in the right place.

Useful skills:

  • C++ exceptions
  • Addrman serialization
  • Functional tests

Want to work on this issue?

For guidance on contributing, please read CONTRIBUTING.md before opening your pull request.

@junderw
Copy link
Contributor

junderw commented Jan 29, 2022

I have proposed a fix for this in #24201

junderw added a commit to junderw/bitcoin that referenced this issue Feb 6, 2022
fixes bitcoin#24188
When downgrading, a peers.dat with a future version that has a minimum
required version larger than the downgraded version would cause an InitError.

This commit changes this behavior to overwrite the existing peers.dat with
a new empty one.
nolim1t pushed a commit to nolim1t/bitcoin-upstream that referenced this issue Feb 25, 2022
d41ed32 p2p: Avoid InitError when downgrading peers.dat (junderw)

Pull request description:

  fixes bitcoin#24188 (also see bitcoin#22762 (comment))
  When downgrading, a peers.dat with a future version that has a minimum
  required version larger than the downgraded Bitcoin Core version would cause an InitError.

  This commit changes this behavior to overwrite the existing peers.dat with
  a new empty one.

ACKs for top commit:
  prayank23:
    reACK bitcoin@d41ed32
  kallewoof:
    reACK d41ed32

Tree-SHA512: c8e625fe36ce0b1aab6c8ef7241c8954038bb856f2de27bdc4814dc9a60e51be28815c7d77d0f96eace49687a0cea02deb713978bbd3a5add742f50a675f2a40
sidhujag pushed a commit to syscoin/syscoin that referenced this issue Feb 25, 2022
d41ed32 p2p: Avoid InitError when downgrading peers.dat (junderw)

Pull request description:

  fixes bitcoin#24188 (also see bitcoin#22762 (comment))
  When downgrading, a peers.dat with a future version that has a minimum
  required version larger than the downgraded Bitcoin Core version would cause an InitError.

  This commit changes this behavior to overwrite the existing peers.dat with
  a new empty one.

ACKs for top commit:
  prayank23:
    reACK bitcoin@d41ed32
  kallewoof:
    reACK d41ed32

Tree-SHA512: c8e625fe36ce0b1aab6c8ef7241c8954038bb856f2de27bdc4814dc9a60e51be28815c7d77d0f96eace49687a0cea02deb713978bbd3a5add742f50a675f2a40
@bitcoin bitcoin locked and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants