This commit is contained in:
vub 2013-10-08 05:38:00 -04:00
parent 44d740f84e
commit 38ea108183
3 changed files with 3 additions and 3 deletions

2
bitcoinjs-min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -86,7 +86,7 @@ Transaction.prototype.addOutput = function (address, value) {
value = value.toByteArrayUnsigned().reverse();
while (value.length < 8) value.push(0);
} else if (typeof value == "number") {
value = util.numToBytes(value);
value = util.numToBytes(value,8);
} else if (util.isArray(value)) {
// Nothing to do
}

View file

@ -26,7 +26,7 @@ module.exports = {
* Create a byte array representing a number with the given length
*/
numToBytes: function(num,bytes) {
if (bytes == 0 || (bytes === null && num === 0)) return [];
if (bytes == 0 || (bytes === undefined && num === 0)) return [];
else return [num % 256].concat(module.exports.numToBytes(Math.floor(num / 256),bytes-1));
},
/**