| 72 | } |
| 73 | |
| 74 | bool CScriptView::IsPayToWitnessScriptHash() const { |
| 75 | // Extra-fast test for pay-to-witness-script-hash CScripts: |
| 76 | return (this->size() == 34 && |
| 77 | (*this)[0] == OP_0 && |
| 78 | (*this)[1] == 0x20); |
| 79 | } |
| 80 | |
| 81 | // A witness program is any valid CScript that consists of a 1-byte push opcode |
| 82 | // followed by a data push between 2 and 40 bytes. |