| 106 | } |
| 107 | |
| 108 | bool CScriptView::IsPushOnly(iterator pc) const { |
| 109 | while (pc < end()) { |
| 110 | opcodetype opcode; |
| 111 | if (!GetOp(pc, opcode)) { |
| 112 | return false; |
| 113 | } |
| 114 | // Note that IsPushOnly() *does* consider OP_RESERVED to be a |
| 115 | // push-type opcode, however execution of OP_RESERVED fails, so |
| 116 | // it's not relevant to P2SH/BIP62 as the scriptSig would fail prior to |
| 117 | // the P2SH special validation code being executed. |
| 118 | if (opcode > OP_16) { |
| 119 | return false; |
| 120 | } |
| 121 | } |
| 122 | return true; |
| 123 | } |
| 124 | |
| 125 | bool CScriptView::IsPushOnly() const { |
| 126 | return this->IsPushOnly(begin()); |
no test coverage detected