Skip to content

Commit

Permalink
Merge #11568: Disconnect outbound peers on invalid chains
Browse files Browse the repository at this point in the history
37886d5 Disconnect outbound peers relaying invalid headers (Suhas Daftuar)
4637f18 moveonly: factor out headers processing into separate function (Suhas Daftuar)

Pull request description:

  Alternate to #11446.

  Disconnect outbound (non-manual) peers that serve us block headers that are already known to be invalid, but exempt compact block announcements from such disconnects.

  We restrict disconnection to outbound peers that are using up an outbound connection slot, because we rely on those peers to give us connectivity to the honest network (our inbound peers are not chosen by us and hence could all be from an attacker/sybil).  Maintaining connectivity to peers that serve us invalid headers is sometimes desirable, eg after a soft-fork, to protect unupgraded software from being partitioned off the honest network, so we prefer to only disconnect when necessary.

  Compact block announcements are exempted from this logic to comply with BIP 152, which explicitly permits nodes to relay compact blocks before fully validating them.

Tree-SHA512: 3ea88e4ccc1184f292a85b17f800d401d2c3806fefc7ad5429d05d6872c53acfa5751e3df83ce6b9c0060ab289511ed70ae1323d140ccc5b12e3c8da6de49936
  • Loading branch information
sipa committed Oct 28, 2017
2 parents b5545d8 + 37886d5 commit ba216b5
Show file tree
Hide file tree
Showing 3 changed files with 226 additions and 172 deletions.

0 comments on commit ba216b5

Please sign in to comment.