Open braydonf opened 8 years ago
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.
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 areject
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: https://github.com/bitpay/bitcore-p2p/issues/85