|
@ -621,10 +621,9 @@ WalletService.prototype._getBlockchainExplorer = function(network) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* _getUtxos |
|
|
* Returns list of UTXOs |
|
|
* |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
WalletService.prototype._getUtxos = function(cb) { |
|
|
WalletService.prototype.getUtxos = function(cb) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -735,7 +734,7 @@ WalletService.prototype._computeKbToSendMax = function(utxos, amount, cb) { |
|
|
WalletService.prototype.getBalance = function(opts, cb) { |
|
|
WalletService.prototype.getBalance = function(opts, cb) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
self._getUtxos(function(err, utxos) { |
|
|
self.getUtxos(function(err, utxos) { |
|
|
if (err) return cb(err); |
|
|
if (err) return cb(err); |
|
|
|
|
|
|
|
|
var balance = self._totalizeUtxos(utxos); |
|
|
var balance = self._totalizeUtxos(utxos); |
|
@ -867,7 +866,7 @@ WalletService.prototype._selectTxInputs = function(txp, cb) { |
|
|
return _.pluck(_.sortBy(list, 'order'), 'utxo'); |
|
|
return _.pluck(_.sortBy(list, 'order'), 'utxo'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
self._getUtxos(function(err, utxos) { |
|
|
self.getUtxos(function(err, utxos) { |
|
|
if (err) return cb(err); |
|
|
if (err) return cb(err); |
|
|
|
|
|
|
|
|
var balance = self._totalizeUtxos(utxos); |
|
|
var balance = self._totalizeUtxos(utxos); |
|
|