diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2014-10-08 18:48:59 -0700 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2014-10-25 03:03:20 -0700 |
commit | 698c6abb25c1fbbc7fa4ba46b60e9f17d97332ef (patch) | |
tree | 96e1a25fa76033be494f9760be03872e5ba554eb /src/script/interpreter.h | |
parent | d752ba86c1872f64a4641cf77008826d32bde65f (diff) |
Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)
Also use the new flag as a standard rule, and replace the IsCanonicalPush
standardness check with it (as it is more complete).
Diffstat (limited to 'src/script/interpreter.h')
-rw-r--r-- | src/script/interpreter.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/script/interpreter.h b/src/script/interpreter.h index 085cd867da..5133c80aab 100644 --- a/src/script/interpreter.h +++ b/src/script/interpreter.h @@ -49,6 +49,13 @@ enum // Using a non-push operator in the scriptSig causes script failure (softfork safe, BIP62 rule 2). SCRIPT_VERIFY_SIGPUSHONLY = (1U << 5), + + // Require minimal encodings for all push operations (OP_0... OP_16, OP_1NEGATE where possible, direct + // pushes up to 75 bytes, OP_PUSHDATA up to 255 bytes, OP_PUSHDATA2 for anything larger). Evaluating + // any other push causes the script to fail (BIP62 rule 3). + // In addition, whenever a stack element is interpreted as a number, it must be of minimal length (BIP62 rule 4). + // (softfork safe) + SCRIPT_VERIFY_MINIMALDATA = (1U << 6) }; uint256 SignatureHash(const CScript &scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType); |