MCPcopy Index your code
hub / github.com/bcoin-org/bcoin / isMultisigInput

Method isMultisigInput

lib/script/script.js:2295–2317  ·  view source on GitHub ↗

* "Guess" whether the input script is pay-to-multisig. * This method is not 100% reliable. * @returns {Boolean}

()

Source from the content-addressed store, hash-verified

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.

Callers 2

getInputTypeMethod · 0.95
getMultisigInputMethod · 0.95

Calls 3

getOpMethod · 0.95
isScripthashInputMethod · 0.95
getLengthMethod · 0.95

Tested by

no test coverage detected