more packet improvements.

This commit is contained in:
Christopher Jeffrey 2016-01-14 01:59:33 -08:00
parent 077588e90a
commit bfca638025
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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;