HomePhabricator

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

Description

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

Summary:
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 <aj@erisian.com.au>

Suhas Daftuar <sdaftuar@gmail.com>

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

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
Matt Corallo <git@bluematt.me>Authored on Jan 16 2019, 03:11
deadalnixCommitted on Jun 24 2020, 13:33
deadalnixPushed on Jun 24 2020, 13:33
Reviewer
Restricted Project
Differential Revision
D6698: [refactor] Add useful-for-dos "reason" field to CValidationState
Parents
rABCe5b59f324ec9: [CI] Wrap build_depends.sh on ibd.sh into functions
Branches
Unknown
Tags
Unknown