| 402 | } |
| 403 | |
| 404 | bool CScript::IsPushOnly(const_iterator pc) const { |
| 405 | while (pc < end()) { |
| 406 | opcodetype opcode; |
| 407 | if (!GetOp(pc, opcode)) { |
| 408 | return false; |
| 409 | } |
| 410 | |
| 411 | // Note that IsPushOnly() *does* consider OP_RESERVED to be a push-type |
| 412 | // opcode, however execution of OP_RESERVED fails, so it's not relevant |
| 413 | // to P2SH/BIP62 as the scriptSig would fail prior to the P2SH special |
| 414 | // validation code being executed. |
| 415 | if (opcode > OP_16) { |
| 416 | return false; |
| 417 | } |
| 418 | } |
| 419 | return true; |
| 420 | } |
| 421 | |
| 422 | bool CScript::IsPushOnly() const { |
| 423 | return this->IsPushOnly(begin()); |