wallet/client: fix arg parsing.

This commit is contained in:
Christopher Jeffrey 2017-10-26 15:48:10 -07:00
parent 749d4edc11
commit a313ac244c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 5 additions and 7 deletions

View File

@ -74,7 +74,7 @@ Config.prototype.init = function init(options) {
this.alias[key] = value; this.alias[key] = value;
} }
} }
} };
/** /**
* Inject options. * Inject options.

View File

@ -26,7 +26,7 @@ class WalletClient extends NodeClient {
}); });
this.parse('block disconnect', (entry) => { this.parse('block disconnect', (entry) => {
return parseEntry(entry); return [parseEntry(entry)];
}); });
this.parse('block rescan', (entry, txs) => { this.parse('block rescan', (entry, txs) => {
@ -34,11 +34,11 @@ class WalletClient extends NodeClient {
}); });
this.parse('chain reset', (tip) => { this.parse('chain reset', (tip) => {
return parseEntry(tip); return [parseEntry(tip)];
}); });
this.parse('tx', (tx) => { this.parse('tx', (tx) => {
return TX.fromRaw(tx); return [TX.fromRaw(tx)];
}); });
} }

View File

@ -1789,9 +1789,8 @@ WalletDB.prototype._addBlock = async function _addBlock(entry, txs) {
// processed (in the case of a crash). // processed (in the case of a crash).
this.logger.warning('Already saw WalletDB block (%d).', tip.height); this.logger.warning('Already saw WalletDB block (%d).', tip.height);
} else if (tip.height !== this.state.height + 1) { } else if (tip.height !== this.state.height + 1) {
// throw new Error('WDB: Bad connection (height mismatch).');
await this.scan(this.state.height); await this.scan(this.state.height);
return; return 0;
} }
// Sync the state to the new tip. // 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) { WalletDB.prototype.addTX = async function addTX(tx) {
const unlock = await this.txLock.lock(); const unlock = await this.txLock.lock();
try { try {
return await this._insert(tx); return await this._insert(tx);
} finally { } finally {