more packet improvements.
This commit is contained in:
parent
077588e90a
commit
bfca638025
@ -354,6 +354,9 @@ Framer.block = function _block(block, type) {
|
|||||||
// flags
|
// flags
|
||||||
for (i = 0; i < block.flags.length; i++)
|
for (i = 0; i < block.flags.length; i++)
|
||||||
p[off++] = block.flags[i];
|
p[off++] = block.flags[i];
|
||||||
|
} else if (type === 'header') {
|
||||||
|
// txn_count
|
||||||
|
off += utils.writeIntv(p, block.txs.length, off);
|
||||||
} else {
|
} else {
|
||||||
// txn_count
|
// txn_count
|
||||||
off += utils.writeIntv(p, block.txs.length, off);
|
off += utils.writeIntv(p, block.txs.length, off);
|
||||||
|
|||||||
@ -306,7 +306,7 @@ Parser.prototype.parseHeaders = function parseHeaders(p) {
|
|||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
header = {};
|
header = {};
|
||||||
start = off;
|
start = off;
|
||||||
header.version = readU32(p, off);
|
header.version = utils.read32(p, off);
|
||||||
off += 4;
|
off += 4;
|
||||||
header.prevBlock = utils.toArray(p.slice(off, off + 32));
|
header.prevBlock = utils.toArray(p.slice(off, off + 32));
|
||||||
off += 32;
|
off += 32;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user