From 3f1946cd7efc11ec225d907a46d65144eca408e7 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 24 Sep 2016 02:41:01 -0700 Subject: [PATCH] refactor: lint. misc. --- lib/db/lowlevelup.js | 2 +- lib/net/pool.js | 8 ++++---- package.json | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/db/lowlevelup.js b/lib/db/lowlevelup.js index fd8e78d3..7d43d81a 100644 --- a/lib/db/lowlevelup.js +++ b/lib/db/lowlevelup.js @@ -386,7 +386,7 @@ LowlevelUp.prototype.clone = co(function* clone(path) { break; batch.put(item.key, item.value); - total += value.length; + total += item.value.length; if (total >= hwm) { total = 0; diff --git a/lib/net/pool.js b/lib/net/pool.js index 0a4cbf74..ed77a425 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -1364,10 +1364,10 @@ Pool.prototype._handleTX = co(function* _handleTX(tx, peer) { throw err; } - // if (missing) { - // for (i = 0; i < missing.length; i++) - // yield this.getData(peer, this.txType, missing[i]); - // } + if (this.options.requestMissing && missing) { + for (i = 0; i < missing.length; i++) + yield this.getData(peer, this.txType, missing[i]); + } this.emit('tx', tx, peer); }); diff --git a/package.json b/package.json index ccb5dda1..be1cdcc1 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,8 @@ "test": "mocha --reporter spec test/*-test.js", "browserify": "browserify --im -o browser/bcoin.js lib/bcoin.js", "uglify": "uglifyjs -m -o browser/bcoin.min.js browser/bcoin.js", - "clean": "rm browser/bcoin.js browser/bcoin.min.js" + "clean": "rm browser/bcoin.js browser/bcoin.min.js", + "hint": "jshint lib/ || exit 0" }, "repository": "git://github.com/bcoin-org/bcoin.git", "keywords": [ @@ -47,12 +48,12 @@ "socket.io-client": "1.4.8" }, "devDependencies": { - "browserify": "13.1.0", "babelify": "7.3.0", "babel-preset-es2015": "6.14.0", "babel-polyfill": "6.13.0", "babel-plugin-transform-runtime": "6.12.0", "babel-plugin-transform-regenerator": "6.14.0", + "browserify": "13.1.0", "hash.js": "1.0.3", "jsdoc": "3.4.0", "level-js": "2.2.4",