fix Buffer.concat use

This commit is contained in:
Manuel Araoz 2014-02-18 16:03:29 -03:00
parent 4da3285930
commit e0233f02dd
5 changed files with 9 additions and 9 deletions

View File

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

View File

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

View File

@ -303,7 +303,7 @@ function spec(b) {
v2 = this.stackTop(1);
this.stackPop();
this.stackPop();
this.stack.push(buffertools.concat(v1, v2));
this.stack.push(Buffer.concat([v1, v2]));
break;
case OP_SUBSTR:

View File

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

View File

@ -320,7 +320,7 @@ var varIntBuf = exports.varIntBuf = function varIntBuf(n) {
};
var varStrBuf = exports.varStrBuf = function varStrBuf(s) {
return buffertools.concat(varIntBuf(s.length), s);
return Buffer.concat([varIntBuf(s.length), s]);
};
// Initializations