aboutsummaryrefslogtreecommitdiff
path: root/src/consensus/tx_check.cpp
Commit message (Collapse)AuthorAgeFilesLines
* scripted-diff: Bump copyright of files changed in 2019MarcoFalke2019-12-301-1/+1
| | | | | | -BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
* [validation] Remove useless ret parameter from Invalid()John Newbery2019-10-291-9/+9
| | | | | | ValidationState::Invalid() takes a parameter `ret` which is returned to the caller. All call sites set this to false. Remove the `ret` parameter and just return false always.
* [validation] Add CValidationState subclassesJohn Newbery2019-10-291-10/+10
| | | | | Split CValidationState into TxValidationState and BlockValidationState to store validation results for transactions and blocks respectively.
* consensus: Explain why fCheckDuplicateInputs can not be skipped and remove itMarcoFalke2019-10-241-9/+10
|
* [validation] Remove REJECT code from CValidationStateJohn Newbery2019-10-101-9/+9
| | | | | We no longer send BIP 61 REJECT messages, so there's no need to set a REJECT code in the CValidationState object.
* Added comments referencing multiple CVEs in tests and production code.lucash-dev2019-06-021-1/+1
| | | | | | | | | | | | | This commit adds comments referencing multiple CVEs both in production and test code. CVEs covered in this commit: CVE-2010-5137 CVE-2010-5139 CVE-2010-5141 CVE-2012-1909 CVE-2012-2459 CVE-2012-3789 CVE-2018-17144
* scripted-diff: Remove DoS calls to CValidationStateMatt Corallo2019-05-021-9/+9
| | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/\.DoS(\(.*\), REJECT_\(.*\), \(true\|false\)/.DoS(\1, REJECT_\2/' src/validation.cpp src/consensus/tx_verify.cpp src/consensus/tx_check.cpp sed -i 's/state.GetRejectCode(), state.GetRejectReason(), [^,]\+, state.GetDebugMessage())/state.GetRejectCode(), state.GetRejectReason(), state.GetDebugMessage())/' src/validation.cpp sed -i 's/\.DoS([^,]*, /.Invalid\(/' src/validation.cpp src/consensus/tx_verify.cpp src/consensus/tx_check.cpp -END VERIFY SCRIPT- Co-authored-by: Suhas Daftuar <[email protected]>
* [refactor] Add useful-for-dos "reason" field to CValidationStateMatt Corallo2019-05-021-9/+9
| | | | | | | | | | | | 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]>
* Clean up banning levelsMatt Corallo2019-05-021-3/+3
| | | | | | | | | | | | | | | | | | | | Compared with previous bans, the following changes are made: * Txn with empty vin/vout or null prevouts move from 10 DoS points to 100. * Loose transactions with a dependency loop now result in a ban instead of 10 DoS points. * Many pre-segwit soft-fork errors now result in a ban. Note: Transactions that violate soft-fork script flags since P2SH do not generally result in a ban. Also, banning behavior for invalid blocks is dependent on whether the node is validating with multiple script check threads, due to a long- standing bug. That inconsistency is still present after this commit. * Proof of work failure moves from 50 DoS points to a ban. * Blocks with timestamps under MTP now result in a ban, blocks too far in the future continue to *not* result in a ban. * Inclusion of non-final transactions in a block now results in a ban instead of 10 DoS points. Co-authored-by: Anthony Towns <[email protected]>
* [build] Move CheckTransaction from lib_server to lib_consensusJohn Newbery2019-04-091-0/+57
CheckTransaction is a context-free function that does not require access to the blockchain or mempool. Move it from src/consensus/tx_verify in lib_server to a new unit src/consensus/tx_check in lib_consensus so that it can be called by non-server libraries.