* Test whether the output script is a witness program. * Note that this will return true even for malformed * witness v0 programs. * @return {Boolean}
()
| 2086 | */ |
| 2087 | |
| 2088 | isProgram() { |
| 2089 | if (this.raw.length < 4 || this.raw.length > 42) |
| 2090 | return false; |
| 2091 | |
| 2092 | if (this.raw[0] !== opcodes.OP_0 |
| 2093 | && (this.raw[0] < opcodes.OP_1 || this.raw[0] > opcodes.OP_16)) { |
| 2094 | return false; |
| 2095 | } |
| 2096 | |
| 2097 | if (this.raw[1] + 2 !== this.raw.length) |
| 2098 | return false; |
| 2099 | |
| 2100 | return true; |
| 2101 | } |
| 2102 | |
| 2103 | /** |
| 2104 | * Get the witness program if present. |
no outgoing calls
no test coverage detected