aboutsummaryrefslogtreecommitdiff
path: root/src/script/interpreter.h
diff options
context:
space:
mode:
authorJohnson Lau <jl2012@xbt.hk>2018-04-27 03:56:29 +0800
committerJohnson Lau <jl2012@xbt.hk>2018-05-05 04:26:12 +0800
commit9dabfe49c066301ef75bcfcb089fd308366127c4 (patch)
tree9640b1303dc21c3dc68463833d9f34145a118b2e /src/script/interpreter.h
parent627c3762ce5d8ce097f70c7fb52a3640246fae9b (diff)
downloadbitcoin-9dabfe49c066301ef75bcfcb089fd308366127c4.tar.xz
Add constant scriptCode policy in non-segwit scripts
This disables OP_CODESEPARATOR in non-segwit scripts (even in an unexecuted branch), and makes a positive FindAndDelete result invalid. This ensures that the scriptCode serialized in SignatureHash() is always the same as the script passing to the EvalScript.
Diffstat (limited to 'src/script/interpreter.h')
-rw-r--r--src/script/interpreter.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/script/interpreter.h b/src/script/interpreter.h
index 50c747900a..2800473a68 100644
--- a/src/script/interpreter.h
+++ b/src/script/interpreter.h
@@ -111,6 +111,10 @@ enum
// Public keys in segregated witness scripts must be compressed
//
SCRIPT_VERIFY_WITNESS_PUBKEYTYPE = (1U << 15),
+
+ // Making OP_CODESEPARATOR and FindAndDelete fail any non-segwit scripts
+ //
+ SCRIPT_VERIFY_CONST_SCRIPTCODE = (1U << 16),
};
bool CheckSignatureEncoding(const std::vector<unsigned char> &vchSig, unsigned int flags, ScriptError* serror);