From 7259ffa91e5452f94d2810fcc7724c89db56b1aa Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 14 Aug 2016 19:08:02 -0700 Subject: [PATCH] lint. --- lib/bcoin/http/rpc.js | 6 +++--- lib/bcoin/http/rpcclient.js | 4 ---- lib/bcoin/http/server.js | 16 ++++++---------- lib/bcoin/txdb.js | 3 --- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/lib/bcoin/http/rpc.js b/lib/bcoin/http/rpc.js index 6312f3f2..6ab17e2c 100644 --- a/lib/bcoin/http/rpc.js +++ b/lib/bcoin/http/rpc.js @@ -1060,14 +1060,14 @@ RPC.prototype.getmempoolinfo = function getmempoolinfo(args, callback) { }; RPC.prototype.getmempoolancestors = function getmempoolancestors(args, callback) { - if (args.help || args.length < 1 || args.length > 2) { + if (args.help || args.length < 1 || args.length > 2) return callback(new RPCError('getmempoolancestors txid (verbose)')); callback(new Error('Not implemented.')); }; RPC.prototype.getmempooldescendants = function getmempooldescendants(args, callback) { - if (args.help || args.length < 1 || args.length > 2) { - return callback(new RPCError('getmempooldescendants txid (verbose)')); + if (args.help || args.length < 1 || args.length > 2) + return callback(new RPCError('getmempooldescendants txid (verbose)')); callback(new Error('Not implemented.')); }; diff --git a/lib/bcoin/http/rpcclient.js b/lib/bcoin/http/rpcclient.js index 08a068f2..d3bc34f7 100644 --- a/lib/bcoin/http/rpcclient.js +++ b/lib/bcoin/http/rpcclient.js @@ -7,8 +7,6 @@ 'use strict'; var Network = require('../network'); -var utils = require('../utils'); -var assert = utils.assert; var request = require('./request'); /** @@ -46,8 +44,6 @@ function RPCClient(options) { */ RPCClient.prototype.call = function call(method, params, callback) { - var self = this; - request({ method: 'POST', uri: this.uri, diff --git a/lib/bcoin/http/server.js b/lib/bcoin/http/server.js index 244fd4bd..927726a2 100644 --- a/lib/bcoin/http/server.js +++ b/lib/bcoin/http/server.js @@ -583,7 +583,6 @@ HTTPServer.prototype._init = function _init() { // Create wallet this.post('/wallet/:id?', function(req, res, next, send) { - var json; self.walletdb.create(req.options, function(err, wallet) { if (err) return next(err); @@ -709,8 +708,6 @@ HTTPServer.prototype._init = function _init() { // Abandon Wallet TX this.del('/wallet/:id/tx/:hash', function(req, res, next, send) { var hash = req.options.hash; - var account = req.options.account; - req.wallet.abandon(hash, function(err) { if (err) return next(err); @@ -1264,12 +1261,12 @@ ClientSocket.prototype.bind = function bind(obj, event, listener) { }; ClientSocket.prototype.unbind = function unbind(obj, event) { - var i, event; + var i, item; for (i = this.events.length - 1; i >= 0; i--) { - event = this.events[i] - if (event[0] === obj && event[1] === event) { - obj.removeListener(event, event[2]); + item = this.events[i]; + if (item[0] === obj && item[1] === event) { + obj.removeListener(event, item[2]); this.events.splice(i, 1); } } @@ -1316,7 +1313,7 @@ ClientSocket.prototype.unwatchChain = function unwatchChain() { this.unbind(this.mempool, 'tx'); }; -ClientSocket.prototype.testBlock = function testBlock(tx) { +ClientSocket.prototype.testBlock = function testBlock(block) { var txs = []; var i, tx; @@ -1352,9 +1349,8 @@ ClientSocket.prototype.testFilter = function testFilter(tx) { ClientSocket.prototype.scan = function scan(start, callback) { var self = this; - var hash; + var hashes = Object.keys(this.filter); - hashes = Object.keys(this.filter); start = utils.revHex(start); this.chain.db.scan(start, hashes, function(tx, entry, next) { diff --git a/lib/bcoin/txdb.js b/lib/bcoin/txdb.js index 24869ffc..67e9719f 100644 --- a/lib/bcoin/txdb.js +++ b/lib/bcoin/txdb.js @@ -1327,9 +1327,6 @@ TXDB.prototype.getLast = function getLast(account, limit, callback) { */ TXDB.prototype.getHistory = function getHistory(account, callback) { - var self = this; - var txs = []; - if (typeof account === 'function') { callback = account; account = null;