Skip to content

Handle malformed p2p messages #86

@braydonf

Description

@braydonf

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions