* "Guess" whether the input script is pay-to-multisig. * This method is not 100% reliable. * @returns {Boolean}
()
| 2293 | */ |
| 2294 | |
| 2295 | isMultisigInput() { |
| 2296 | if (this.code.length < 2) |
| 2297 | return false; |
| 2298 | |
| 2299 | if (this.getOp(0) !== opcodes.OP_0) |
| 2300 | return false; |
| 2301 | |
| 2302 | if (this.getOp(1) > opcodes.OP_PUSHDATA4) |
| 2303 | return false; |
| 2304 | |
| 2305 | // We need to rule out scripthash |
| 2306 | // because it may look like multisig. |
| 2307 | if (this.isScripthashInput()) |
| 2308 | return false; |
| 2309 | |
| 2310 | for (let i = 1; i < this.code.length; i++) { |
| 2311 | const size = this.getLength(i); |
| 2312 | if (size < 9 || size > 73) |
| 2313 | return false; |
| 2314 | } |
| 2315 | |
| 2316 | return true; |
| 2317 | } |
| 2318 | |
| 2319 | /** |
| 2320 | * Get multisig signatures if present. |
no test coverage detected