| 209 | } |
| 210 | |
| 211 | bool CScript::IsPayToWitnessScriptHash() const |
| 212 | { |
| 213 | // Extra-fast test for pay-to-witness-script-hash CScripts: |
| 214 | return (this->size() == 34 && |
| 215 | (*this)[0] == OP_0 && |
| 216 | (*this)[1] == 0x20); |
| 217 | } |
| 218 | |
| 219 | // A witness program is any valid CScript that consists of a 1-byte push opcode |
| 220 | // followed by a data push between 2 and 40 bytes. |