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

network: correct parsing of reject messages #1423

Merged
merged 1 commit into from
Dec 2, 2020
Merged

network: correct parsing of reject messages #1423

merged 1 commit into from
Dec 2, 2020

Conversation

hdevalence
Copy link
Contributor

Not all reject messages include a data field. This change partially addresses
a problem that could lead to a depleted peer set:

  1. We send a response to a getheaders message;
  2. The remote peer rejects our headers message for some reason;
  3. We fail to parse their reject message and close the connection;
  4. Repeating this process, we have no more peers.

This commit fixes (3) but does not address (2).

teor2345
teor2345 previously approved these changes Dec 2, 2020
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems good.

Not all reject messages include a data field.  This change partially addresses
a problem that could lead to a depleted peer set:

1. We send a response to a `getheaders` message;
2. The remote peer `reject`s our `headers` message for some reason;
3. We fail to parse their `reject` message and close the connection;
4. Repeating this process, we have no more peers.

This commit fixes (3) but does not address (2).
@hdevalence
Copy link
Contributor Author

Rebased to pick up fmt fixes in #1427

@dconnolly dconnolly merged commit 69ba558 into main Dec 2, 2020
@dconnolly dconnolly deleted the reject-fix branch December 2, 2020 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants