| 371 | } |
| 372 | |
| 373 | bool CScript::IsPayToScriptHash() const { |
| 374 | // Extra-fast test for pay-to-script-hash CScripts: |
| 375 | return (this->size() == 23 && (*this)[0] == OP_HASH160 && |
| 376 | (*this)[1] == 0x14 && (*this)[22] == OP_EQUAL); |
| 377 | } |
| 378 | |
| 379 | // A witness program is any valid CScript that consists of a 1-byte push opcode |
| 380 | // followed by a data push between 2 and 40 bytes. |