Merge pull request #7281: Improve CheckInputs() comment about sig verification

fd83615 Improve CheckInputs() comment about sig verification (Peter Todd)
This commit is contained in:
Wladimir J. van der Laan 2016-01-19 13:23:20 +01:00
commit f9fd4c2884
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -1636,9 +1636,12 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsVi
// Only if ALL inputs pass do we perform expensive ECDSA signature checks. // Only if ALL inputs pass do we perform expensive ECDSA signature checks.
// Helps prevent CPU exhaustion attacks. // Helps prevent CPU exhaustion attacks.
// Skip ECDSA signature verification when connecting blocks // Skip ECDSA signature verification when connecting blocks before the
// before the last block chain checkpoint. This is safe because block merkle hashes are // last block chain checkpoint. Assuming the checkpoints are valid this
// still computed and checked, and any change will be caught at the next checkpoint. // is safe because block merkle hashes are still computed and checked,
// and any change will be caught at the next checkpoint. Of course, if
// the checkpoint is for a chain that's invalid due to false scriptSigs
// this optimisation would allow an invalid chain to be accepted.
if (fScriptChecks) { if (fScriptChecks) {
for (unsigned int i = 0; i < tx.vin.size(); i++) { for (unsigned int i = 0; i < tx.vin.size(); i++) {
const COutPoint &prevout = tx.vin[i].prevout; const COutPoint &prevout = tx.vin[i].prevout;