Page MenuHomePhabricator

[refactor] Add useful-for-dos "reason" field to CValidationState

Authored by deadalnix on Wed, Jun 24, 01:00.



This is a first step towards cleaning up our DoS interface - make
validation return *why* something is invalid, and let net_processing
figure out what that implies in terms of banning/disconnection/etc.

Behavior change: peers will now be banned for providing blocks
with premature coinbase spends.

Co-authored-by: Anthony Towns <>

Suhas Daftuar <>

This is a partial backport of Core PR15141 :

Test Plan
ninja all check-all

Diff Detail

rABC Bitcoin ABC
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Wed, Jun 24, 01:00
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Jun 24, 01:00
deadalnix requested review of this revision.Wed, Jun 24, 01:00
teamcity edited the summary of this revision. (Show Details)Wed, Jun 24, 01:00

[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 requested changes to this revision.Wed, Jun 24, 08:25
Fabien added a subscriber: Fabien.
Fabien added inline comments.
39 ↗(On Diff #21675)

That comment needs some segwit clearance. Not sure the enum makes much sense for us at all.

1740 ↗(On Diff #21675)

Note to reviewers: the behavior changed in D6693, now the ban happen in CheckInputs.

This revision now requires changes to proceed.Wed, Jun 24, 08:25
deadalnix updated this revision to Diff 21683.Wed, Jun 24, 13:19


Fabien accepted this revision.Wed, Jun 24, 13:25
This revision is now accepted and ready to land.Wed, Jun 24, 13:25