Browse Source

Bugfix

hk-custom-address
vub 11 years ago
parent
commit
38ea108183
  1. 2
      bitcoinjs-min.js
  2. 2
      src/transaction.js
  3. 2
      src/util.js

2
bitcoinjs-min.js

File diff suppressed because one or more lines are too long

2
src/transaction.js

@ -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
}

2
src/util.js

@ -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));
},
/**

Loading…
Cancel
Save