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

Handle malformed p2p messages #86

Open
braydonf opened this issue May 25, 2016 · 1 comment
Open

Handle malformed p2p messages #86

braydonf opened this issue May 25, 2016 · 1 comment

Comments

@braydonf
Copy link
Contributor

braydonf commented May 25, 2016

When parsing the buffer, the message itself may be malformed and unable to parse correctly, which will typically throw an error (as so it's clear why it's failing).

A try/catch around https://github.com/bitpay/bitcore-p2p/blob/master/lib/messages/index.js#L103 and sending back a reject message (https://en.bitcoin.it/wiki/Protocol_documentation#reject) to the peer with REJECT_MALFORMED, could be the best way to handle this case.

Related: #85

@Fi3
Copy link

Fi3 commented Jul 16, 2016

I have fix this this issue but I don't know how make a new pull request.
I have done a repo on my account with this issue fixed (maybe :) ) https://github.com/Fi3/bitcore-p2p.
I have try to follow your contibuting guideline. If you think that could be good add my code to your repo feel free to merge my branch.

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

No branches or pull requests

2 participants