1. 16 Feb, 2017 1 commit
  2. 15 Feb, 2017 5 commits
  3. 14 Feb, 2017 6 commits
  4. 13 Feb, 2017 8 commits
    • Cory Fields's avatar
      qa: add a test to detect leaky p2p messages · 137d576a
      Cory Fields authored
      This is certainly not exhaustive, but it's better than nothing. Adds checks
      for:
      
      - Any message received before sending a version
      - Any message received other than version/reject before sending a verack
      
      It also tries to goad the remote into sending a pong, address, or block
      announcement.
      137d576a
    • Matt Corallo's avatar
      15306d86
    • Matt Corallo's avatar
    • Cory Fields's avatar
      net: require a verack before responding to anything else · dbb210cc
      Cory Fields authored
      7a8c2519 made this logic hard to follow. After that change, messages would
      not be sent to a peer via SendMessages() before the handshake was complete, but
      messages could still be sent as a response to an incoming message.
      
      For example, if a peer had not yet sent a verack, we wouldn't notify it about
      new blocks, but we would respond to a PING with a PONG.
      
      This change makes the behavior straightforward: until we've received a verack,
      never send any message other than version/verack/reject.
      
      The behavior until a VERACK is received has always been undefined, this change
      just tightens our policy.
      
      This also makes testing much easier, because we can now connect but not send
      version/verack, and anything sent to us is an error.
      dbb210cc
    • Cory Fields's avatar
      net: parse reject earlier · 8b2ab3bf
      Cory Fields authored
      Prior to this change, all messages were ignored until a VERSION message was
      received, as well as possibly incurring a ban score.
      
      Since REJECT messages can be sent at any time (including as a response to a bad
      VERSION message), make sure to always parse them.
      
      Moving this parsing up keeps it from being caught in the
      if (pfrom->nVersion == 0) check below.
      8b2ab3bf
    • Cory Fields's avatar
      net: correctly ban before the handshake is complete · a8453966
      Cory Fields authored
      7a8c2519 made a change to avoid getting into SendMessages() until the
      version handshake (VERSION + VERACK) is complete. That was done to avoid
      leaking out messages to nodes who could connect, but never bothered sending
      us their version/verack.
      
      Unfortunately, the ban tally and possible disconnect are done as part of
      SendMessages(). So after 7a8c2519, if a peer managed to do something
      bannable before completing the handshake (say send 100 non-version messages
      before their version), they wouldn't actually end up getting
      disconnected/banned. That's fixed here by checking the banscore as part of
      ProcessMessages() in addition to SendMessages().
      a8453966
    • Russell Yanofsky's avatar
      Return error when importmulti called with invalid address. · 2abc144d
      Russell Yanofsky authored
      Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
      2abc144d
    • Luke Dashjr's avatar
  5. 11 Feb, 2017 2 commits
  6. 10 Feb, 2017 18 commits