MCPcopy Create free account
hub / github.com/bcoin-org/bcoin / getNulldata

Method getNulldata

lib/script/script.js:2042–2054  ·  view source on GitHub ↗

* Get OP_RETURN data if present. * @param {Boolean} [minimal=false] - Minimaldata only. * @returns {Buffer|null}

(minimal)

Source from the content-addressed store, hash-verified

2040 */
2041
2042 getNulldata(minimal) {
2043 if (!this.isNulldata(minimal))
2044 return null;
2045
2046 for (let i = 1; i < this.code.length; i++) {
2047 const op = this.code[i];
2048 const data = op.toPush();
2049 if (data)
2050 return data;
2051 }
2052
2053 return EMPTY_BUFFER;
2054 }
2055
2056 /**
2057 * Test whether the output script is a segregated witness

Callers

nothing calls this directly

Calls 2

isNulldataMethod · 0.95
toPushMethod · 0.80

Tested by

no test coverage detected