Page MenuHomePhabricator

[refactor] Refactor misbehavior ban decisions to MaybePunishNode()
ClosedPublic

Authored by deadalnix on Jun 23 2020, 15:16.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/net_processing.cpp
3081 ↗(On Diff #21641)

Undo

3084 ↗(On Diff #21641)

Dito

This revision is now accepted and ready to land.Jun 23 2020, 15:47
This revision was landed with ongoing or failed builds.Jun 23 2020, 16:42
This revision was automatically updated to reflect the committed changes.