HomePhabricator

[refactor] Refactor misbehavior ban decisions to MaybePunishNode()

Description

[refactor] Refactor misbehavior ban decisions to MaybePunishNode()

Summary:
Isolate the decision of whether to ban a peer to one place in the
code, rather than having it sprinkled throughout net_processing.

Co-authored-by: Anthony Towns <aj@erisian.com.au>

Suhas Daftuar <sdaftuar@gmail.com>
John Newbery <john@johnnewbery.com>

This is a partial backport of Core PR15141 : https://github.com/bitcoin/bitcoin/pull/15141/commits/8818729013e17c650a25f030b2b80e0997389155

Slightly modified because the original screws with locks and only fixes it toward the end.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6683

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on Apr 16 2018, 16:52
deadalnixCommitted on Jun 23 2020, 16:42
deadalnixPushed on Jun 23 2020, 16:42
Reviewer
Restricted Project
Differential Revision
D6683: [refactor] Refactor misbehavior ban decisions to MaybePunishNode()
Parents
rABC4f31ce8a67fa: [CI] Make the build_autotools.sh script take a list of targets
Branches
Unknown
Tags
Unknown