File tree Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Expand file tree Collapse file tree 2 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -1863,6 +1863,24 @@ bool CScript::IsPayToScriptHash() const
1863
1863
this ->at (22 ) == OP_EQUAL);
1864
1864
}
1865
1865
1866
+ bool CScript::IsPushOnly () const
1867
+ {
1868
+ const_iterator pc = begin ();
1869
+ while (pc < end ())
1870
+ {
1871
+ opcodetype opcode;
1872
+ if (!GetOp (pc, opcode))
1873
+ return false ;
1874
+ // Note that IsPushOnly() *does* consider OP_RESERVED to be a
1875
+ // push-type opcode, however execution of OP_RESERVED fails, so
1876
+ // it's not relevant to P2SH as the scriptSig would fail prior to
1877
+ // the P2SH special validation code being executed.
1878
+ if (opcode > OP_16)
1879
+ return false ;
1880
+ }
1881
+ return true ;
1882
+ }
1883
+
1866
1884
class CScriptVisitor : public boost ::static_visitor<bool >
1867
1885
{
1868
1886
private:
Original file line number Diff line number Diff line change @@ -542,23 +542,7 @@ class CScript : public std::vector<unsigned char>
542
542
bool IsPayToScriptHash () const ;
543
543
544
544
// Called by IsStandardTx
545
- bool IsPushOnly () const
546
- {
547
- const_iterator pc = begin ();
548
- while (pc < end ())
549
- {
550
- opcodetype opcode;
551
- if (!GetOp (pc, opcode))
552
- return false ;
553
- // Note that IsPushOnly() *does* consider OP_RESERVED to be a
554
- // push-type opcode, however execution of OP_RESERVED fails, so
555
- // it's not relevant to P2SH as the scriptSig would fail prior to
556
- // the P2SH special validation code being executed.
557
- if (opcode > OP_16)
558
- return false ;
559
- }
560
- return true ;
561
- }
545
+ bool IsPushOnly () const ;
562
546
563
547
// Returns whether the script is guaranteed to fail at execution,
564
548
// regardless of the initial stack. This allows outputs to be pruned
You can’t perform that action at this time.
0 commit comments