From f5005299d14c8ddb99684e3ffacd68c5c6aad882 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Wed, 4 Jun 2014 14:07:29 +1000 Subject: [PATCH] JSHint: remove defined but never used --- src/ec.js | 1 - src/index.js | 1 - src/transaction.js | 11 +++++------ src/wallet.js | 7 ++++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ec.js b/src/ec.js index 83ebc3a..38e693d 100644 --- a/src/ec.js +++ b/src/ec.js @@ -6,7 +6,6 @@ var assert = require('assert') var BigInteger = require('bigi') // constants -var TWO = BigInteger.valueOf(2) var THREE = BigInteger.valueOf(3) function ECFieldElementFp(q,x) { diff --git a/src/index.js b/src/index.js index fb4c80b..69ea066 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,4 @@ var ec = require('./ec') -var Key = require('./eckey') var T = require('./transaction') module.exports = { diff --git a/src/transaction.js b/src/transaction.js index 0135a1b..be0d0bb 100644 --- a/src/transaction.js +++ b/src/transaction.js @@ -1,16 +1,15 @@ // FIXME: To all ye that enter here, be weary of Buffers, Arrays and Hex interchanging between the outpoints var assert = require('assert') -var Address = require('./address') -var BigInteger = require('bigi') var bufferutils = require('./bufferutils') -var Script = require('./script') -var convert = require('./convert') var crypto = require('./crypto') -var ECKey = require('./eckey') var ecdsa = require('./ecdsa') var opcodes = require('./opcodes') +var Address = require('./address') +var Script = require('./script') +var ECKey = require('./eckey') + var DEFAULT_SEQUENCE = 0xffffffff function Transaction(doc) { @@ -154,7 +153,7 @@ Transaction.prototype.toBuffer = function () { writeUInt32(this.version) writeVarInt(this.ins.length) - this.ins.forEach(function(txin, i) { + this.ins.forEach(function(txin) { var hash = new Buffer(txin.outpoint.hash, 'hex') // FIXME: Performance: convert on tx.addInput instead // TxHash hex is big-endian, we need little-endian diff --git a/src/wallet.js b/src/wallet.js index 2616272..b144206 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -205,11 +205,12 @@ function Wallet(seed, network) { return tx } - function getCandidateOutputs(value){ + function getCandidateOutputs() { var unspent = [] - for (var key in me.outputs){ + + for (var key in me.outputs) { var output = me.outputs[key] - if(!output.spend) unspent.push(output) + if (!output.spend) unspent.push(output) } var sortByValueDesc = unspent.sort(function(o1, o2){