Adds performance notes
This commit is contained in:
parent
4716eb29bf
commit
87048d3b4e
1 changed files with 2 additions and 2 deletions
|
@ -141,7 +141,7 @@ Transaction.prototype.serialize = function () {
|
||||||
|
|
||||||
var offset = 0
|
var offset = 0
|
||||||
function writeSlice(slice) {
|
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)
|
slice.copy(buffer, offset)
|
||||||
offset += slice.length
|
offset += slice.length
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ Transaction.prototype.serialize = function () {
|
||||||
writeVI(this.ins.length)
|
writeVI(this.ins.length)
|
||||||
|
|
||||||
this.ins.forEach(function(txin, i) {
|
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
|
// Hash is big-endian, we want little-endian for the hex
|
||||||
Array.prototype.reverse.call(hash)
|
Array.prototype.reverse.call(hash)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue