From e12a8bb21c07a4bdb950b6aac7c4ced49fddbc85 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 9 Jun 2016 16:23:21 -0700 Subject: [PATCH] lint. --- lib/bcoin/aes.js | 2 +- lib/bcoin/chachapoly.js | 6 +++--- lib/bcoin/pool.js | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/bcoin/aes.js b/lib/bcoin/aes.js index 6d55831a..f6151dc5 100644 --- a/lib/bcoin/aes.js +++ b/lib/bcoin/aes.js @@ -516,7 +516,7 @@ AESCipher.prototype.update = function update(data) { */ AESCipher.prototype.final = function final() { - var i, block, left, pad; + var block, left, pad; // Handle padding on the last block. if (!this.waiting) { diff --git a/lib/bcoin/chachapoly.js b/lib/bcoin/chachapoly.js index 8cb35451..9642ba38 100644 --- a/lib/bcoin/chachapoly.js +++ b/lib/bcoin/chachapoly.js @@ -545,9 +545,6 @@ AEAD.prototype.finish = function finish() { var len = new Buffer(16); var lo, hi; - if (this.cipherLen === 0) - this.pad16(this.aadLen); - // The RFC says these are supposed to be // uint32le, but their own fucking test // cases fail unless they are uint64le's. @@ -561,6 +558,9 @@ AEAD.prototype.finish = function finish() { len.writeUInt32LE(lo, 8, true); len.writeUInt32LE(hi, 12, true); + if (this.cipherLen === 0) + this.pad16(this.aadLen); + this.pad16(this.cipherLen); this.poly1305.update(len); diff --git a/lib/bcoin/pool.js b/lib/bcoin/pool.js index 91e3959c..42c70ac2 100644 --- a/lib/bcoin/pool.js +++ b/lib/bcoin/pool.js @@ -601,6 +601,8 @@ Pool.prototype.startSync = function startSync() { }; Pool.prototype.sync = function sync() { + var i; + if (this.peers.load) this.peers.load.sync(); @@ -613,6 +615,8 @@ Pool.prototype.sync = function sync() { */ Pool.prototype.stopSync = function stopSync() { + var i; + if (!this.syncing) return;