| 478 | } |
| 479 | |
| 480 | bool CScript::HasValidOps() const { |
| 481 | CScript::const_iterator it = begin(); |
| 482 | while (it < end()) { |
| 483 | opcodetype opcode; |
| 484 | std::vector<uint8_t> item; |
| 485 | if (!GetOp(it, opcode, item) || opcode > MAX_OPCODE || |
| 486 | item.size() > MAX_SCRIPT_ELEMENT_SIZE) { |
| 487 | return false; |
| 488 | } |
| 489 | } |
| 490 | return true; |
| 491 | } |