From a8db7b2cbf366ca4a07caf36568c3fc3e26f28da Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 14 Aug 2015 08:23:23 +1000 Subject: [PATCH] block: use Tx.byteLength to avoid double serialization --- src/block.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/block.js b/src/block.js index dca1f4c..5d4dc1a 100644 --- a/src/block.js +++ b/src/block.js @@ -44,11 +44,10 @@ Block.fromBuffer = function (buffer) { return vi.number } - // FIXME: poor performance function readTransaction () { var tx = Transaction.fromBuffer(buffer.slice(offset), true) - offset += tx.toBuffer().length + offset += tx.byteLength() return tx }