diff --git a/lib/server.js b/lib/server.js index 5a8d636..3ad12bb 100644 --- a/lib/server.js +++ b/lib/server.js @@ -458,7 +458,7 @@ WalletService.prototype._getUtxos = function(cb) { var bc = self._getBlockchainExplorer('insight', networkName); bc.getUnspentUtxos(addressStrs, function(err, inutxos) { - if (err) return cb(err); + if (err) return cb(new Error('Could not fetch unspend outputs:' + err)); var utxos = _.map(inutxos, function(i) { return _.pick(i.toObject(), ['txid', 'vout', 'address', 'scriptPubKey', 'amount', 'satoshis']); }); @@ -748,7 +748,7 @@ WalletService.prototype.removePendingTx = function(opts, cb) { if (actors.length > 1 || (actors.length == 1 && actors[0] !== self.copayerId)) return cb(new ClientError('TXACTIONED', 'Cannot remove a proposal signed/rejected by other copayers')); - self._notify('transactionProposalRemoved'); + self._notify('TxProposalRemoved'); self.storage.removeTx(self.walletId, txp.id, cb); }); }); @@ -1121,7 +1121,7 @@ WalletService.prototype.getTxHistory = function(opts, cb) { }, function(next) { bc.getTransactions(addressStrs, null, null, function(err, txs) { - if (err) return next(err); + if (err) return next(new Error('Could not fetch transactions: ' + err)); next(null, self._normalizeTxHistory(txs)); }); @@ -1179,7 +1179,7 @@ WalletService.prototype.scan = function(opts, cb) { if (err) return next(err); allAddresses.push(addresses); checkActivity(_.pluck(addresses, 'address'), function(err, thereIsActivity) { - if (err) return next(err); + if (err) return next(new Error('Could not fetch TX activity:' + err)); activity = thereIsActivity; next(); });