From 698c6abb25c1fbbc7fa4ba46b60e9f17d97332ef Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 8 Oct 2014 18:48:59 -0700 Subject: 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). --- src/script/interpreter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/script/interpreter.h') 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); -- cgit v1.2.3