block: use Tx.byteLength to avoid double serialization

This commit is contained in:
Daniel Cousens 2015-08-14 08:23:23 +10:00
parent ae0001ce37
commit a8db7b2cbf

View file

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