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

server: Reject outbound conns to non-full nodes. #1251

Commits on Sep 21, 2018

  1. peer: Add duplicate version message test.

    This adds a test to ensure duplicate version messages are rejected.
    
    Backported from Decred.
    davecgh committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    25dfda9 View commit details
    Browse the repository at this point in the history
  2. peer: Rework version negotiation.

    This modifies the negotiation logic to ensure the callback has the
    opportunity to see the message before the peer is disconnected and
    improves the error handling when reading the remote version message.
    
    It also has the side effect of ensuring the protocol version is
    negotiated before sending reject messages with the exception of the
    first message not being a version message since negotiation is not
    possible in that case.
    
    This is being changed because it is useful for the server to see the
    message regardless in order to have the opportunity to things such as
    update the address manager and reject peers that don't have desired
    services.
    
    Backported from Decred.
    davecgh committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    118f552 View commit details
    Browse the repository at this point in the history
  3. peer: Allow OnVersion callback to reject peer.

    This modifies the OnVersion callback to allow a reject message to be
    returned in which case the message will be sent to the peer and the peer
    will be disconnected.
    
    Backported from Decred.
    davecgh committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    7b103e2 View commit details
    Browse the repository at this point in the history
  4. server: Reject outbound conns to non-full nodes.

    This modifies the server connection code to reject outbound peers that
    do not offer full node services.
    davecgh committed Sep 21, 2018
    Configuration menu
    Copy the full SHA
    9151ebc View commit details
    Browse the repository at this point in the history