Changeset View
Changeset View
Standalone View
Standalone View
src/script/standard.h
Show All 35 Lines | |||||
/** | /** | ||||
* A data carrying output is an unspendable output containing data. The script | * A data carrying output is an unspendable output containing data. The script | ||||
* type is designated as TX_NULL_DATA. | * type is designated as TX_NULL_DATA. | ||||
*/ | */ | ||||
extern bool fAcceptDatacarrier; | extern bool fAcceptDatacarrier; | ||||
/** | /** | ||||
* Mandatory script verification flags that all new blocks must comply with for | * A set of flags used for a variety of unrelated purposes: | ||||
* them to be valid (but old blocks may not comply with). | * - Together with STANDARD_SCRIPT_VERIFY_FLAGS, this is used to calculate | ||||
* | * STANDARD_NOT_MANDATORY_VERIFY_FLAGS, which is the set of flags that | ||||
* Failing one of these tests may trigger a DoS ban - see CheckInputs() for | * transactions are allowed to violate that result in only rejecting the | ||||
* details. | * transaction, instead of banning the peer. | ||||
* (see CheckInputs() in validation.cpp). | |||||
* - Used in some tests as an arbitrary set of flags, for some strange reason. | |||||
* - Used in the (deprecated) DataFromTransaction scriptSig analyzer during | |||||
* signing, for some strange reason. | |||||
* - Note this is *not* used in block validation. It also does not represent the | |||||
* validation flags for a typical current block. Many blocks, both past and | |||||
* current, contain transactions that outright fail under this flag set. | |||||
deadalnix: I don't think a listing of where this is used is a good idea ever. These place will be changed… | |||||
markblundebergAuthorUnsubmitted Done Inline ActionsYeah my plan is to fix all those other places which are misusing these flags, really it should only be used for a single purpose which is the one you describe (the first one in my list). In fact I'd suggest we don't even need this flagset, really we just ought to pay attention to what is in STANDARD_NOT_MANDATORY_VERIFY_FLAGS. Nonetheless, the current comment describing this flag is simply wrong. markblundeberg: Yeah my plan is to fix all those other places which are misusing these flags, really it should… | |||||
*/ | */ | ||||
static const uint32_t MANDATORY_SCRIPT_VERIFY_FLAGS = | static const uint32_t MANDATORY_SCRIPT_VERIFY_FLAGS = | ||||
SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | | SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | | ||||
SCRIPT_ENABLE_SIGHASH_FORKID | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_NULLFAIL; | SCRIPT_ENABLE_SIGHASH_FORKID | SCRIPT_VERIFY_LOW_S | SCRIPT_VERIFY_NULLFAIL; | ||||
enum txnouttype { | enum txnouttype { | ||||
TX_NONSTANDARD, | TX_NONSTANDARD, | ||||
// 'standard' transaction types: | // 'standard' transaction types: | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |
I don't think a listing of where this is used is a good idea ever. These place will be changed over time, but this comment will stay, providing completely misleading information.
The main purpose of this set of flag is that, if you receive a transaction that is not valid as per one of these, then you can ban the peer.