aboutsummaryrefslogtreecommitdiff
path: root/src/script.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2014-02-11 12:44:42 -0800
committerGregory Maxwell <greg@xiph.org>2014-02-11 12:44:42 -0800
commit2bc52f1c4a7d66661ed26e100a914e68df6d2bcc (patch)
tree193f73d99ddbd70a67b5aafdcf353174f2cf4a96 /src/script.h
parentd5fa3eff03b4e58fc46d72599904231408cbce80 (diff)
parent87fe71e1fc810ee120a10063fdd26c3245686d54 (diff)
Merge pull request #3025 from sipa/noncanpush
Make signatures with non-canonical data pushes non-standard.
Diffstat (limited to 'src/script.h')
-rw-r--r--src/script.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/script.h b/src/script.h
index bd120cc07d..335ddfb1b2 100644
--- a/src/script.h
+++ b/src/script.h
@@ -541,24 +541,11 @@ public:
bool IsPayToScriptHash() const;
- // Called by IsStandardTx
- bool IsPushOnly() const
- {
- const_iterator pc = begin();
- while (pc < end())
- {
- opcodetype opcode;
- if (!GetOp(pc, opcode))
- return false;
- // Note that IsPushOnly() *does* consider OP_RESERVED to be a
- // push-type opcode, however execution of OP_RESERVED fails, so
- // it's not relevant to P2SH as the scriptSig would fail prior to
- // the P2SH special validation code being executed.
- if (opcode > OP_16)
- return false;
- }
- return true;
- }
+ // Called by IsStandardTx and P2SH VerifyScript (which makes it consensus-critical).
+ bool IsPushOnly() const;
+
+ // Called by IsStandardTx.
+ bool HasCanonicalPushes() const;
// Returns whether the script is guaranteed to fail at execution,
// regardless of the initial stack. This allows outputs to be pruned