|
|
@ -1588,14 +1588,26 @@ bool CheckInputs(const CTransaction& tx, CValidationState &state, CCoinsViewCach |
|
|
|
pvChecks->push_back(CScriptCheck()); |
|
|
|
pvChecks->push_back(CScriptCheck()); |
|
|
|
check.swap(pvChecks->back()); |
|
|
|
check.swap(pvChecks->back()); |
|
|
|
} else if (!check()) { |
|
|
|
} else if (!check()) { |
|
|
|
if (flags & SCRIPT_VERIFY_STRICTENC) { |
|
|
|
if (flags & STANDARD_NOT_MANDATORY_VERIFY_FLAGS) { |
|
|
|
// For now, check whether the failure was caused by non-canonical
|
|
|
|
// Check whether the failure was caused by a
|
|
|
|
// encodings or not; if so, don't trigger DoS protection.
|
|
|
|
// non-mandatory script verification check, such as
|
|
|
|
CScriptCheck check(coins, tx, i, flags & (~SCRIPT_VERIFY_STRICTENC), 0); |
|
|
|
// non-standard DER encodings or non-null dummy
|
|
|
|
|
|
|
|
// arguments; if so, don't trigger DoS protection to
|
|
|
|
|
|
|
|
// avoid splitting the network between upgraded and
|
|
|
|
|
|
|
|
// non-upgraded nodes.
|
|
|
|
|
|
|
|
CScriptCheck check(coins, tx, i, |
|
|
|
|
|
|
|
flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS, 0); |
|
|
|
if (check()) |
|
|
|
if (check()) |
|
|
|
return state.Invalid(false, REJECT_NONSTANDARD, "non-canonical"); |
|
|
|
return state.Invalid(false, REJECT_NONSTANDARD, "non-mandatory-script-verify-flag"); |
|
|
|
} |
|
|
|
} |
|
|
|
return state.DoS(100,false, REJECT_NONSTANDARD, "non-canonical"); |
|
|
|
// Failures of other flags indicate a transaction that is
|
|
|
|
|
|
|
|
// invalid in new blocks, e.g. a invalid P2SH. We DoS ban
|
|
|
|
|
|
|
|
// such nodes as they are not following the protocol. That
|
|
|
|
|
|
|
|
// said during an upgrade careful thought should be taken
|
|
|
|
|
|
|
|
// as to the correct behavior - we may want to continue
|
|
|
|
|
|
|
|
// peering with non-upgraded nodes even after a soft-fork
|
|
|
|
|
|
|
|
// super-majority vote has passed.
|
|
|
|
|
|
|
|
return state.DoS(100,false, REJECT_INVALID, "mandatory-script-verify-flag-failed"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|