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

Method isStandard

lib/script/script.js:1752–1769  ·  view source on GitHub ↗

* Test whether the script is standard by policy standards. * @returns {Boolean}

()

Source from the content-addressed store, hash-verified

1750 */
1751
1752 isStandard() {
1753 const [m, n] = this.getMultisig();
1754
1755 if (m !== -1) {
1756 if (n < 1 || n > 3)
1757 return false;
1758
1759 if (m < 1 || m > n)
1760 return false;
1761
1762 return true;
1763 }
1764
1765 if (this.isNulldata())
1766 return this.raw.length <= policy.MAX_OP_RETURN_BYTES;
1767
1768 return this.getType() !== scriptTypes.NONSTANDARD;
1769 }
1770
1771 /**
1772 * Calculate the size of the script

Callers

nothing calls this directly

Calls 3

getMultisigMethod · 0.95
isNulldataMethod · 0.95
getTypeMethod · 0.95

Tested by

no test coverage detected