diff --git a/lib/node/config.js b/lib/node/config.js index 50acda61..0d1684d7 100644 --- a/lib/node/config.js +++ b/lib/node/config.js @@ -74,7 +74,7 @@ Config.prototype.init = function init(options) { this.alias[key] = value; } } -} +}; /** * Inject options. diff --git a/lib/wallet/client.js b/lib/wallet/client.js index 224fc86c..3f5c5a8f 100644 --- a/lib/wallet/client.js +++ b/lib/wallet/client.js @@ -26,7 +26,7 @@ class WalletClient extends NodeClient { }); this.parse('block disconnect', (entry) => { - return parseEntry(entry); + return [parseEntry(entry)]; }); this.parse('block rescan', (entry, txs) => { @@ -34,11 +34,11 @@ class WalletClient extends NodeClient { }); this.parse('chain reset', (tip) => { - return parseEntry(tip); + return [parseEntry(tip)]; }); this.parse('tx', (tx) => { - return TX.fromRaw(tx); + return [TX.fromRaw(tx)]; }); } diff --git a/lib/wallet/walletdb.js b/lib/wallet/walletdb.js index 9975fb07..548a1fcb 100644 --- a/lib/wallet/walletdb.js +++ b/lib/wallet/walletdb.js @@ -1789,9 +1789,8 @@ WalletDB.prototype._addBlock = async function _addBlock(entry, txs) { // processed (in the case of a crash). this.logger.warning('Already saw WalletDB block (%d).', tip.height); } else if (tip.height !== this.state.height + 1) { - // throw new Error('WDB: Bad connection (height mismatch).'); await this.scan(this.state.height); - return; + return 0; } // Sync the state to the new tip. @@ -1921,7 +1920,6 @@ WalletDB.prototype.rescanBlock = async function rescanBlock(entry, txs) { WalletDB.prototype.addTX = async function addTX(tx) { const unlock = await this.txLock.lock(); - try { return await this._insert(tx); } finally {