Skip to content

Commit cba69dd

Browse files
ajtownsachow101
authored andcommitted
Move MANDATORY_SCRIPT_VERIFY_FLAGS from script/standard.h to policy/policy.h
1 parent b565485 commit cba69dd

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/policy/policy.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,22 @@ static constexpr unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT_KVB{101};
6969
* configurable as it doesn't materially change DoS parameters.
7070
*/
7171
static constexpr unsigned int EXTRA_DESCENDANT_TX_SIZE_LIMIT{10000};
72+
73+
74+
/**
75+
* Mandatory script verification flags that all new transactions must comply with for
76+
* them to be valid. Failing one of these tests may trigger a DoS ban;
77+
* see CheckInputScripts() for details.
78+
*
79+
* Note that this does not affect consensus validity; see GetBlockScriptFlags()
80+
* for that.
81+
*/
82+
static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH;
83+
7284
/**
7385
* Standard script verification flags that standard transactions will comply
74-
* with. However scripts violating these flags may still be present in valid
75-
* blocks and we must accept those blocks.
86+
* with. However we do not ban/disconnect nodes that forward txs violating
87+
* these rules, for better forwards and backwards compatability.
7688
*/
7789
static constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS{MANDATORY_SCRIPT_VERIFY_FLAGS |
7890
SCRIPT_VERIFY_DERSIG |

src/script/standard.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ class CScriptID : public BaseHash<uint160>
3838
*/
3939
static const unsigned int MAX_OP_RETURN_RELAY = 83;
4040

41-
/**
42-
* Mandatory script verification flags that all new blocks must comply with for
43-
* them to be valid. (but old blocks may not comply with) Currently just P2SH,
44-
* but in the future other flags may be added.
45-
*
46-
* Failing one of these tests may trigger a DoS ban - see CheckInputScripts() for
47-
* details.
48-
*/
49-
static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH;
50-
5141
enum class TxoutType {
5242
NONSTANDARD,
5343
// 'standard' transaction types:

0 commit comments

Comments
 (0)