Browse Source

block: use Tx.byteLength to avoid double serialization

hk-custom-address
Daniel Cousens 10 years ago
parent
commit
a8db7b2cbf
  1. 3
      src/block.js

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

Loading…
Cancel
Save