lint: no extra parens around !await.
This commit is contained in:
parent
88ef28d837
commit
e38da91065
@ -600,7 +600,7 @@ Chain.prototype.verifyInputs = async function verifyInputs(block, prev, state) {
|
|||||||
|
|
||||||
// Ensure tx is not double spending an output.
|
// Ensure tx is not double spending an output.
|
||||||
if (i > 0) {
|
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!');
|
assert(!historical, 'BUG: Spent inputs in historical data!');
|
||||||
throw new VerifyError(block,
|
throw new VerifyError(block,
|
||||||
'invalid',
|
'invalid',
|
||||||
@ -684,7 +684,7 @@ Chain.prototype.verifyInputs = async function verifyInputs(block, prev, state) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Verify all txs in parallel.
|
// Verify all txs in parallel.
|
||||||
if (!(await co.every(jobs))) {
|
if (!await co.every(jobs)) {
|
||||||
throw new VerifyError(block,
|
throw new VerifyError(block,
|
||||||
'invalid',
|
'invalid',
|
||||||
'mandatory-script-verify-flag-failed',
|
'mandatory-script-verify-flag-failed',
|
||||||
@ -1137,7 +1137,7 @@ Chain.prototype._replay = async function _replay(block, silent) {
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
throw new Error('Block not found.');
|
throw new Error('Block not found.');
|
||||||
|
|
||||||
if (!(await entry.isMainChain()))
|
if (!await entry.isMainChain())
|
||||||
throw new Error('Cannot reset on alternate chain.');
|
throw new Error('Cannot reset on alternate chain.');
|
||||||
|
|
||||||
if (entry.isGenesis()) {
|
if (entry.isGenesis()) {
|
||||||
|
|||||||
@ -1201,7 +1201,7 @@ ChainDB.prototype.scan = async function scan(start, filter, iter) {
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(await entry.isMainChain()))
|
if (!await entry.isMainChain())
|
||||||
throw new Error('Cannot rescan an alternate chain.');
|
throw new Error('Cannot rescan an alternate chain.');
|
||||||
|
|
||||||
let total = 0;
|
let total = 0;
|
||||||
@ -1478,7 +1478,7 @@ ChainDB.prototype.reset = async function reset(block) {
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
throw new Error('Block not found.');
|
throw new Error('Block not found.');
|
||||||
|
|
||||||
if (!(await entry.isMainChain()))
|
if (!await entry.isMainChain())
|
||||||
throw new Error('Cannot reset on alternate chain.');
|
throw new Error('Cannot reset on alternate chain.');
|
||||||
|
|
||||||
if (this.options.prune)
|
if (this.options.prune)
|
||||||
|
|||||||
@ -432,7 +432,7 @@ CoinView.prototype.readInputs = async function readInputs(db, tx) {
|
|||||||
let found = true;
|
let found = true;
|
||||||
|
|
||||||
for (const {prevout} of tx.inputs) {
|
for (const {prevout} of tx.inputs) {
|
||||||
if (!(await this.readCoin(db, prevout)))
|
if (!await this.readCoin(db, prevout))
|
||||||
found = false;
|
found = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -446,7 +446,7 @@ HTTPServer.prototype.handleAuth = function handleAuth(socket) {
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!(await entry.isMainChain()))
|
if (!await entry.isMainChain())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return entry.toRaw();
|
return entry.toRaw();
|
||||||
|
|||||||
@ -782,7 +782,7 @@ Mempool.prototype.insertTX = async function insertTX(tx, id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Verify transaction finality (see isFinal()).
|
// Verify transaction finality (see isFinal()).
|
||||||
if (!(await this.verifyFinal(tx, lockFlags))) {
|
if (!await this.verifyFinal(tx, lockFlags)) {
|
||||||
throw new VerifyError(tx,
|
throw new VerifyError(tx,
|
||||||
'nonstandard',
|
'nonstandard',
|
||||||
'non-final',
|
'non-final',
|
||||||
@ -864,7 +864,7 @@ Mempool.prototype.verify = async function verify(entry, view) {
|
|||||||
const tx = entry.tx;
|
const tx = entry.tx;
|
||||||
|
|
||||||
// Verify sequence locks.
|
// Verify sequence locks.
|
||||||
if (!(await this.verifyLocks(tx, view, lockFlags))) {
|
if (!await this.verifyLocks(tx, view, lockFlags)) {
|
||||||
throw new VerifyError(tx,
|
throw new VerifyError(tx,
|
||||||
'nonstandard',
|
'nonstandard',
|
||||||
'non-BIP68-final',
|
'non-BIP68-final',
|
||||||
|
|||||||
@ -1717,7 +1717,7 @@ Pool.prototype.handleBlockInv = async function handleBlockInv(peer, hashes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Request the block if we don't have it.
|
// Request the block if we don't have it.
|
||||||
if (!(await this.hasBlock(hash))) {
|
if (!await this.hasBlock(hash)) {
|
||||||
items.push(hash);
|
items.push(hash);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -108,7 +108,7 @@ NodeClient.prototype.getEntry = async function getEntry(hash) {
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if (!(await entry.isMainChain()))
|
if (!await entry.isMainChain())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
|
|||||||
@ -1512,7 +1512,7 @@ RPC.prototype.importPrunedFunds = async function importPrunedFunds(args, help) {
|
|||||||
height: height
|
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.');
|
throw new RPCError(errs.WALLET_ERROR, 'No tracked address for TX.');
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
@ -1529,7 +1529,7 @@ RPC.prototype.removePrunedFunds = async function removePrunedFunds(args, help) {
|
|||||||
if (!hash)
|
if (!hash)
|
||||||
throw new RPCError(errs.TYPE_ERROR, 'Invalid parameter.');
|
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.');
|
throw new RPCError(errs.WALLET_ERROR, 'Transaction not in wallet.');
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -162,7 +162,7 @@ async function reserializeUndo(hash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!blockData) {
|
if (!blockData) {
|
||||||
if (!(await isPruned()))
|
if (!await isPruned())
|
||||||
throw new Error(`Block not found: ${tip.hash}.`);
|
throw new Error(`Block not found: ${tip.hash}.`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -137,7 +137,7 @@ describe('Chain', function() {
|
|||||||
assert(tip1);
|
assert(tip1);
|
||||||
assert(tip2);
|
assert(tip2);
|
||||||
|
|
||||||
assert(!(await tip2.isMainChain()));
|
assert(!await tip2.isMainChain());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -93,7 +93,7 @@ describe('Node', function() {
|
|||||||
assert(tip1);
|
assert(tip1);
|
||||||
assert(tip2);
|
assert(tip2);
|
||||||
|
|
||||||
assert(!(await tip2.isMainChain()));
|
assert(!await tip2.isMainChain());
|
||||||
|
|
||||||
await co.wait();
|
await co.wait();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user