From 87048d3b4eae4c9d83e1a6a2db083d8b130f8486 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sun, 4 May 2014 08:28:31 +1000 Subject: [PATCH] Adds performance notes --- src/transaction.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transaction.js b/src/transaction.js index e4c1349..468360d 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -141,7 +141,7 @@ Transaction.prototype.serialize = function () { var offset = 0 function writeSlice(slice) { - if (Array.isArray(slice)) slice = new Buffer(slice) + if (Array.isArray(slice)) slice = new Buffer(slice) // FIXME: Performance: transitionary only slice.copy(buffer, offset) offset += slice.length } @@ -162,7 +162,7 @@ Transaction.prototype.serialize = function () { writeVI(this.ins.length) this.ins.forEach(function(txin, i) { - var hash = new Buffer(txin.outpoint.hash, 'hex') + var hash = new Buffer(txin.outpoint.hash, 'hex') // FIXME: Performance: convert on tx.addInput instead // Hash is big-endian, we want little-endian for the hex Array.prototype.reverse.call(hash)