Skip to content

Commit 5d8709c

Browse files
petertoddjtimon
authored andcommitted
Add IsPushOnly(const_iterator pc)
Allows IsPushOnly() to be applied to just part of the script for OP_RETURN outputs.
1 parent 6a07eb6 commit 5d8709c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/script/script.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,8 @@ bool CScript::IsPayToScriptHash() const
210210
this->at(22) == OP_EQUAL);
211211
}
212212

213-
bool CScript::IsPushOnly() const
213+
bool CScript::IsPushOnly(const_iterator pc) const
214214
{
215-
const_iterator pc = begin();
216215
while (pc < end())
217216
{
218217
opcodetype opcode;
@@ -227,3 +226,8 @@ bool CScript::IsPushOnly() const
227226
}
228227
return true;
229228
}
229+
230+
bool CScript::IsPushOnly() const
231+
{
232+
return this->IsPushOnly(begin());
233+
}

src/script/script.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ class CScript : public std::vector<unsigned char>
589589
bool IsPayToScriptHash() const;
590590

591591
/** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */
592+
bool IsPushOnly(const_iterator pc) const;
592593
bool IsPushOnly() const;
593594

594595
/**

0 commit comments

Comments
 (0)