src/coins/compress.js
function sizeScript(script) {
  if (script.isPubkeyhash(true))
    return 21;

  if (script.isScripthash())
    return 21;

  const pk = script.getPubkey(true);
  if (pk) {
    if (publicKeyVerify(pk))
      return 33;
  }

  let size = 0;
  size += encoding.sizeVarint(script.raw.length + COMPRESS_TYPES);
  size += script.raw.length;

  return size;
}
function sizeScript(script) {
  if (script.isPubkeyhash(true))
    return 21;

  if (script.isScripthash())
    return 21;

  const pk = script.getPubkey(true);
  if (pk) {
    if (publicKeyVerify(pk))
      return 33;
  }

  let size = 0;
  size += encoding.sizeVarint(script.raw.length + COMPRESS_TYPES);
  size += script.raw.length;

  return size;
}
function sizeScript ( script ) { if ( script . isPubkeyhash ( true ) ) return 21 ; if ( script . isScripthash ( ) ) return 21 ; const pk = script . getPubkey ( true ) ; if ( pk ) { if ( publicKeyVerify ( pk ) ) return 33 ; } let size = 0 ; size += encoding . sizeVarint ( script . raw . length + COMPRESS_TYPES ) ; size += script . raw . length ; return size ; }
Calculate script size.
@returns {Number}
Calculate script size .