aboutsummaryrefslogtreecommitdiff
path: root/src/script/script.cpp
diff options
context:
space:
mode:
authorPeter Todd <pete@petertodd.org>2014-11-04 12:38:56 -0500
committerJorge Timón <jtimon@jtimon.cc>2015-10-01 18:28:11 +0200
commit5d8709c3b7fcc66fbf537ec0b6c1a98d69214e25 (patch)
treeee5385b59d430542d8f8195a6f33988e322bf107 /src/script/script.cpp
parent6a07eb676a020b0035173facb25f92f1ff6380f7 (diff)
downloadbitcoin-5d8709c3b7fcc66fbf537ec0b6c1a98d69214e25.tar.xz
Add IsPushOnly(const_iterator pc)
Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs.
Diffstat (limited to 'src/script/script.cpp')
-rw-r--r--src/script/script.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/script/script.cpp b/src/script/script.cpp
index 58dbade0e2..0a8ec9fa7b 100644
--- a/src/script/script.cpp
+++ b/src/script/script.cpp
@@ -210,9 +210,8 @@ bool CScript::IsPayToScriptHash() const
this->at(22) == OP_EQUAL);
}
-bool CScript::IsPushOnly() const
+bool CScript::IsPushOnly(const_iterator pc) const
{
- const_iterator pc = begin();
while (pc < end())
{
opcodetype opcode;
@@ -227,3 +226,8 @@ bool CScript::IsPushOnly() const
}
return true;
}
+
+bool CScript::IsPushOnly() const
+{
+ return this->IsPushOnly(begin());
+}