lint: no extra parens around !await.

This commit is contained in:
Christopher Jeffrey 2017-07-31 12:17:34 -07:00
parent 88ef28d837
commit e38da91065
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
11 changed files with 16 additions and 16 deletions

View File

@ -600,7 +600,7 @@ Chain.prototype.verifyInputs = async function verifyInputs(block, prev, state) {
// Ensure tx is not double spending an output.
if (i > 0) {
if (!(await view.spendInputs(this.db, tx))) {
if (!await view.spendInputs(this.db, tx)) {
assert(!historical, 'BUG: Spent inputs in historical data!');
throw new VerifyError(block,
'invalid',
@ -684,7 +684,7 @@ Chain.prototype.verifyInputs = async function verifyInputs(block, prev, state) {
}
// Verify all txs in parallel.
if (!(await co.every(jobs))) {
if (!await co.every(jobs)) {
throw new VerifyError(block,
'invalid',
'mandatory-script-verify-flag-failed',
@ -1137,7 +1137,7 @@ Chain.prototype._replay = async function _replay(block, silent) {
if (!entry)
throw new Error('Block not found.');
if (!(await entry.isMainChain()))
if (!await entry.isMainChain())
throw new Error('Cannot reset on alternate chain.');
if (entry.isGenesis()) {

View File

@ -1201,7 +1201,7 @@ ChainDB.prototype.scan = async function scan(start, filter, iter) {
if (!entry)
return;
if (!(await entry.isMainChain()))
if (!await entry.isMainChain())
throw new Error('Cannot rescan an alternate chain.');
let total = 0;
@ -1478,7 +1478,7 @@ ChainDB.prototype.reset = async function reset(block) {
if (!entry)
throw new Error('Block not found.');
if (!(await entry.isMainChain()))
if (!await entry.isMainChain())
throw new Error('Cannot reset on alternate chain.');
if (this.options.prune)

View File

@ -432,7 +432,7 @@ CoinView.prototype.readInputs = async function readInputs(db, tx) {
let found = true;
for (const {prevout} of tx.inputs) {
if (!(await this.readCoin(db, prevout)))
if (!await this.readCoin(db, prevout))
found = false;
}

View File

@ -446,7 +446,7 @@ HTTPServer.prototype.handleAuth = function handleAuth(socket) {
if (!entry)
return null;
if (!(await entry.isMainChain()))
if (!await entry.isMainChain())
return null;
return entry.toRaw();

View File

@ -782,7 +782,7 @@ Mempool.prototype.insertTX = async function insertTX(tx, id) {
}
// Verify transaction finality (see isFinal()).
if (!(await this.verifyFinal(tx, lockFlags))) {
if (!await this.verifyFinal(tx, lockFlags)) {
throw new VerifyError(tx,
'nonstandard',
'non-final',
@ -864,7 +864,7 @@ Mempool.prototype.verify = async function verify(entry, view) {
const tx = entry.tx;
// Verify sequence locks.
if (!(await this.verifyLocks(tx, view, lockFlags))) {
if (!await this.verifyLocks(tx, view, lockFlags)) {
throw new VerifyError(tx,
'nonstandard',
'non-BIP68-final',

View File

@ -1717,7 +1717,7 @@ Pool.prototype.handleBlockInv = async function handleBlockInv(peer, hashes) {
}
// Request the block if we don't have it.
if (!(await this.hasBlock(hash))) {
if (!await this.hasBlock(hash)) {
items.push(hash);
continue;
}

View File

@ -108,7 +108,7 @@ NodeClient.prototype.getEntry = async function getEntry(hash) {
if (!entry)
return null;
if (!(await entry.isMainChain()))
if (!await entry.isMainChain())
return null;
return entry;

View File

@ -1512,7 +1512,7 @@ RPC.prototype.importPrunedFunds = async function importPrunedFunds(args, help) {
height: height
};
if (!(await this.wdb.addTX(tx, entry)))
if (!await this.wdb.addTX(tx, entry))
throw new RPCError(errs.WALLET_ERROR, 'No tracked address for TX.');
return null;
@ -1529,7 +1529,7 @@ RPC.prototype.removePrunedFunds = async function removePrunedFunds(args, help) {
if (!hash)
throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.');
if (!(await wallet.remove(hash)))
if (!await wallet.remove(hash))
throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.');
return null;

View File

@ -162,7 +162,7 @@ async function reserializeUndo(hash) {
}
if (!blockData) {
if (!(await isPruned()))
if (!await isPruned())
throw new Error(`Block not found: ${tip.hash}.`);
break;
}

View File

@ -137,7 +137,7 @@ describe('Chain', function() {
assert(tip1);
assert(tip2);
assert(!(await tip2.isMainChain()));
assert(!await tip2.isMainChain());
}
});

View File

@ -93,7 +93,7 @@ describe('Node', function() {
assert(tip1);
assert(tip2);
assert(!(await tip2.isMainChain()));
assert(!await tip2.isMainChain());
await co.wait();
}