fixed concat references

This commit is contained in:
Manuel Araoz 2014-02-18 14:27:19 -03:00
parent 1dcd941331
commit d96181898a
4 changed files with 10 additions and 10 deletions

View File

@ -182,7 +182,7 @@ function spec(b) {
var i2 = Math.min(i + 1, size - 1); var i2 = Math.min(i + 1, size - 1);
var a = tree[j + i]; var a = tree[j + i];
var b = tree[j + i2]; var b = tree[j + i2];
tree.push(util.twoSha256(a.concat(b))); tree.push(util.twoSha256(buffertools.concat(a,b)));
} }
j += size; j += size;
} }

View File

@ -382,7 +382,7 @@ function spec(b) {
Script.prototype.writeBytes = function (data) Script.prototype.writeBytes = function (data)
{ {
var newSize = this.buffer.length + prefixSize(data.length) + data.length; var newSize = this.buffer.length + prefixSize(data.length) + data.length;
this.buffer = Buffer.concat([this.buffer, encodeLen(data.length), data]); this.buffer = buffertools.concat(this.buffer, encodeLen(data.length), data);
this.chunks.push(data); this.chunks.push(data);
}; };

View File

@ -299,11 +299,11 @@ function spec(b) {
case OP_CAT: case OP_CAT:
// (x1 x2 -- out) // (x1 x2 -- out)
var v1 = this.stackTop(2); v1 = this.stackTop(2);
var v2 = this.stackTop(1); v2 = this.stackTop(1);
this.stackPop(); this.stackPop();
this.stackPop(); this.stackPop();
this.stack.push(v1.concat(v2)); this.stack.push(buffertools.concat(v1, v2));
break; break;
case OP_SUBSTR: case OP_SUBSTR:

View File

@ -17,7 +17,7 @@ function spec(b) {
var VerificationError = error.VerificationError; var VerificationError = error.VerificationError;
var MissingSourceError = error.MissingSourceError; var MissingSourceError = error.MissingSourceError;
var COINBASE_OP = buffertools.concat(util.NULL_HASH, new Buffer("FFFFFFFF", 'hex')); var COINBASE_OP = buffertools.concat(util.NULL_HASH, new Buffer('FFFFFFFF', 'hex'));
function TransactionIn(data) { function TransactionIn(data) {
if ("object" !== typeof data) { if ("object" !== typeof data) {
@ -44,7 +44,7 @@ function spec(b) {
var qbuf = new Buffer(4); var qbuf = new Buffer(4);
qbuf.writeUInt32LE(this.q, 0); qbuf.writeUInt32LE(this.q, 0);
return Buffer.concat([this.o, slen, this.s, qbuf]); return buffertools.concat(this.o, slen, this.s, qbuf);
}; };
TransactionIn.prototype.getOutpointHash = function getOutpointHash() { TransactionIn.prototype.getOutpointHash = function getOutpointHash() {
@ -88,7 +88,7 @@ function spec(b) {
TransactionOut.prototype.serialize = function serialize() { TransactionOut.prototype.serialize = function serialize() {
var slen = util.varIntBuf(this.s.length); var slen = util.varIntBuf(this.s.length);
return Buffer.concat([this.v, slen, this.s]); return buffertools.concat(his.v, slen, this.s);
}; };
function Transaction(data) { function Transaction(data) {
@ -537,7 +537,7 @@ function spec(b) {
var buffer = bytes.buffer(); var buffer = bytes.buffer();
// Append hashType // Append hashType
buffer = buffer.concat(new Buffer([parseInt(hashType), 0, 0, 0])); buffer = buffertools.concat(buffer, new Buffer([parseInt(hashType), 0, 0, 0]));
return util.twoSha256(buffer); return util.twoSha256(buffer);
}; };
@ -612,7 +612,7 @@ function spec(b) {
var voutBuf = new Buffer(4); var voutBuf = new Buffer(4);
voutBuf.writeUInt32LE(vout, 0); voutBuf.writeUInt32LE(vout, 0);
txin.o = Buffer.concat([hash, voutBuf]); txin.o = buffertools.concat(hash, voutBuf);
txobj.ins.push(txin); txobj.ins.push(txin);
}); });