diff options
| author | Matt Corallo <[email protected]> | 2019-01-16 13:11:13 +1000 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2019-05-02 14:55:13 -0400 |
| commit | 34477ccd39a8d4bfa8ad612f22d5a46291922185 (patch) | |
| tree | cb10c04ca46dc532d59d8da2c5ca797e54093b9e /src/test | |
| parent | Ban all peers for all block script failures (diff) | |
| download | discoin-34477ccd39a8d4bfa8ad612f22d5a46291922185.tar.xz discoin-34477ccd39a8d4bfa8ad612f22d5a46291922185.zip | |
[refactor] Add useful-for-dos "reason" field to CValidationState
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 <[email protected]>
Suhas Daftuar <[email protected]>
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/txvalidation_tests.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/test/txvalidation_tests.cpp b/src/test/txvalidation_tests.cpp index 4876c44f1..aa3012936 100644 --- a/src/test/txvalidation_tests.cpp +++ b/src/test/txvalidation_tests.cpp @@ -52,6 +52,7 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_reject_coinbase, TestChain100Setup) // Check that the validation state reflects the unsuccessful attempt. BOOST_CHECK(state.IsInvalid()); BOOST_CHECK_EQUAL(state.GetRejectReason(), "coinbase"); + BOOST_CHECK(state.GetReason() == ValidationInvalidReason::CONSENSUS); } BOOST_AUTO_TEST_SUITE_END() |