Page MenuHomePhabricator

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

Authored by deadalnix on Tue, Jun 23, 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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Tue, Jun 23, 15:16
Herald added a reviewer: Restricted Project. · View Herald TranscriptTue, Jun 23, 15:16
deadalnix requested review of this revision.Tue, Jun 23, 15:16
teamcity edited the summary of this revision. (Show Details)Tue, Jun 23, 15:16

[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 accepted this revision.Tue, Jun 23, 15:47
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.Tue, Jun 23, 15:47
This revision was landed with ongoing or failed builds.Tue, Jun 23, 16:42
This revision was automatically updated to reflect the committed changes.