bcb-stream-parser
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "bcb-stream-parser", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Parse BitCoin-Block via NodeJS.ReadableStream", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs", |
@@ -81,3 +81,3 @@ /// <reference types="node" /> | ||
} | undefined; | ||
export declare function readHeader(read: Read): () => Promise<{ | ||
export declare function readHeader(read: Read): (readTxCount?: boolean) => Promise<{ | ||
type: "HEADER"; | ||
@@ -84,0 +84,0 @@ version: number; |
@@ -233,5 +233,6 @@ 'use strict'; | ||
const compactSizeThunk = readCompactSize(read); | ||
return async function () { | ||
return async function (readTxCount = true) { | ||
const chunk = await read(80); | ||
const { readUInt32LE, slice } = proxyBind.bond(chunk); | ||
const hash = blockHash(chunk); | ||
const p = pointer(0); | ||
@@ -248,4 +249,4 @@ const bytesHex = ramda.compose(toHex, reverseBuffer, ramda.apply(slice), p); | ||
nonce: uint32LE(), | ||
hash: blockHash(chunk), | ||
txCount: await compactSizeThunk(), | ||
hash, | ||
txCount: readTxCount ? await compactSizeThunk() : 0, | ||
}; | ||
@@ -252,0 +253,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
42783
1281