|
|
@ -17,6 +17,7 @@ var Explorers = require('bitcore-explorers'); |
|
|
|
var ClientError = require('./clienterror'); |
|
|
|
var Utils = require('./utils'); |
|
|
|
var Storage = require('./storage'); |
|
|
|
var HDPath = require('./hdpath'); |
|
|
|
var WalletUtils = require('./walletutils'); |
|
|
|
|
|
|
|
var Wallet = require('./model/wallet'); |
|
|
@ -284,13 +285,16 @@ WalletService.prototype.createAddress = function(opts, cb) { |
|
|
|
* @param {Object} opts |
|
|
|
* @returns {Address[]} |
|
|
|
*/ |
|
|
|
WalletService.prototype.getAddresses = function(opts, cb) { |
|
|
|
WalletService.prototype.getMainAddresses = function(opts, cb) { |
|
|
|
var self = this; |
|
|
|
|
|
|
|
self.storage.fetchAddresses(self.walletId, function(err, addresses) { |
|
|
|
if (err) return cb(err); |
|
|
|
var mainAddresses = _.filter(addresses, function(x) { |
|
|
|
return !HDPath.indexesForPath(x.path).isChange; |
|
|
|
}); |
|
|
|
|
|
|
|
return cb(null, addresses); |
|
|
|
return cb(null, mainAddresses); |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
@ -520,7 +524,7 @@ WalletService.prototype.createTx = function(opts, cb) { |
|
|
|
try { |
|
|
|
self._selectUtxos(txp, utxos); |
|
|
|
} catch (ex) { |
|
|
|
console.log('[server.js.523:ex:]',ex); //TODO
|
|
|
|
console.log('[server.js.523:ex:]', ex); //TODO
|
|
|
|
return cb(new ClientError(ex)); |
|
|
|
} |
|
|
|
|
|
|
|