diff --git a/lib/net/peer.js b/lib/net/peer.js index ea4f5055..b9f1fd27 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -1857,7 +1857,7 @@ Peer.prototype.handleFilterClear = async function handleFilterClear(packet) { Peer.prototype.handleFeeFilter = async function handleFeeFilter(packet) { const rate = packet.rate; - if (!(rate >= 0 && rate <= consensus.MAX_MONEY)) { + if (rate < 0 || rate > consensus.MAX_MONEY) { this.increaseBan(100); return; } diff --git a/lib/wallet/rpc.js b/lib/wallet/rpc.js index 3ad05d1c..2bc55b0c 100644 --- a/lib/wallet/rpc.js +++ b/lib/wallet/rpc.js @@ -1150,7 +1150,7 @@ RPC.prototype.listUnspent = async function listUnspent(args, help) { for (const coin of coins) { const depth = coin.getDepth(height); - if (!(depth >= minDepth && depth <= maxDepth)) + if (depth < minDepth || depth > maxDepth) continue; const addr = coin.getAddress(); diff --git a/lib/wallet/txdb.js b/lib/wallet/txdb.js index bcc57cd6..b7367af5 100644 --- a/lib/wallet/txdb.js +++ b/lib/wallet/txdb.js @@ -769,7 +769,7 @@ TXDB.prototype._add = async function _add(tx, block) { // Potentially remove double-spenders. // Only remove if they're not confirmed. - if (!(await this.removeConflicts(tx, true))) + if (!await this.removeConflicts(tx, true)) return null; } else { // Potentially remove double-spenders. @@ -827,7 +827,7 @@ TXDB.prototype.insert = async function insert(wtx, block) { // Do some verification. if (!block) { - if (!(await this.verifyInput(tx, i, coin))) { + if (!await this.verifyInput(tx, i, coin)) { this.clear(); return null; } diff --git a/migrate/coins/coinview.js b/migrate/coins/coinview.js index 6f70250b..91b9e425 100644 --- a/migrate/coins/coinview.js +++ b/migrate/coins/coinview.js @@ -329,7 +329,7 @@ CoinView.prototype.ensureInputs = async function ensureInputs(db, tx) { let found = true; for (const input of tx.inputs) { - if (!(await this.readCoins(db, input.prevout.hash))) + if (!await this.readCoins(db, input.prevout.hash)) found = false; }