| 203 | } |
| 204 | |
| 205 | bool CScript::IsPushOnly(const_iterator pc) const |
| 206 | { |
| 207 | while(pc < end()) |
| 208 | { |
| 209 | opcodetype opcode; //NOLINT(cppcoreguidelines-init-variables) |
| 210 | if (!GetOp(pc, opcode)) return false; |
| 211 | // Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type |
| 212 | // opcode, however execution of OP_RESERVED fails, so it's not relevant |
| 213 | // to P2SH/BIP62 as the scriptSig would fail prior to the P2SH special |
| 214 | // validation code being executed. |
| 215 | if (opcode > OP_16) return false; |
| 216 | } |
| 217 | return true; |
| 218 | } |
| 219 | |
| 220 | bool CScript::IsPushOnly() const { |
| 221 | return this->IsPushOnly(begin()); |
no outgoing calls