diff --git a/lib/bcoin/chaindb.js b/lib/bcoin/chaindb.js index 15f934e8..4dc74f74 100644 --- a/lib/bcoin/chaindb.js +++ b/lib/bcoin/chaindb.js @@ -1734,6 +1734,7 @@ ChainDB.prototype.hasCoins = function hasCoins(hash, callback) { */ ChainDB.prototype.pruneBlock = function pruneBlock(block, callback) { + var self = this; var futureHeight, key; if (this.options.spv) @@ -1803,7 +1804,7 @@ ChainState.prototype.disconnect = function connect(block) { }; ChainState.prototype.add = function add(coin) { - this.coin++ + this.coin++; this.value += coin.value; }; diff --git a/lib/bcoin/locker.js b/lib/bcoin/locker.js index bde2eff1..a632bf7b 100644 --- a/lib/bcoin/locker.js +++ b/lib/bcoin/locker.js @@ -75,7 +75,7 @@ Locker.prototype.hasPending = function hasPending(key) { Locker.prototype.lock = function lock(func, args, force) { var self = this; var callback = args[args.length - 1]; - var obj, called, arg; + var obj, called; if (typeof callback !== 'function') throw new Error(func.name + ' requires a callback.'); diff --git a/lib/bcoin/txdb.js b/lib/bcoin/txdb.js index db227009..dcfacd6c 100644 --- a/lib/bcoin/txdb.js +++ b/lib/bcoin/txdb.js @@ -1263,9 +1263,10 @@ TXDB.prototype.unconfirm = function unconfirm(hash, callback, force) { TXDB.prototype._unconfirm = function unconfirm(tx, info, callback) { var self = this; var hash = tx.hash('hex'); + var height = tx.height; var i, account; - if (tx.height === -1) + if (height === -1) return callback(null, false, info); tx.height = -1; diff --git a/lib/bcoin/walletdb.js b/lib/bcoin/walletdb.js index f687cd80..a3fa61ea 100644 --- a/lib/bcoin/walletdb.js +++ b/lib/bcoin/walletdb.js @@ -640,7 +640,7 @@ WalletDB.prototype.auth = function auth(wid, token, callback) { WalletDB.prototype.create = function create(options, callback) { var self = this; - var wallet, unlock; + var wallet; if (typeof options === 'function') { callback = options; @@ -801,11 +801,11 @@ WalletDB.prototype.getAccounts = function getAccounts(wid, callback) { return callback(err); // Get it out of hash table mode. - accounts = new Array(map.length); + accounts = []; for (i = 0; i < map.length; i++) { assert(map[i] != null); - accounts[i] = map[i]; + accounts.push(map[i]); } callback(null, accounts);