From 5d8709c3b7fcc66fbf537ec0b6c1a98d69214e25 Mon Sep 17 00:00:00 2001 From: Peter Todd Date: Tue, 4 Nov 2014 12:38:56 -0500 Subject: Add IsPushOnly(const_iterator pc) Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs. --- src/script/script.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/script/script.cpp') diff --git a/src/script/script.cpp b/src/script/script.cpp index 58dbade0e..0a8ec9fa7 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()); +} -- cgit v1.2.3