use new multiutxo insight call
This commit is contained in:
parent
e7486c7fe0
commit
9e96bc2188
2 changed files with 15 additions and 19 deletions
|
|
@ -114,26 +114,22 @@ Insight.prototype.getUnspent = function(addresses, cb) {
|
|||
|
||||
var all = [];
|
||||
|
||||
_asyncForEach(addresses, function(addr, callback) {
|
||||
var options = {
|
||||
host: self.host,
|
||||
port: self.port,
|
||||
scheme: self.scheme,
|
||||
method: 'GET',
|
||||
path: '/api/addr/' + addr + '/utxo',
|
||||
var options = {
|
||||
host: self.host,
|
||||
port: self.port,
|
||||
scheme: self.scheme,
|
||||
method: 'GET',
|
||||
path: '/api/addrs/' + addresses.join(',') + '/utxo',
|
||||
|
||||
headers: {
|
||||
'Access-Control-Request-Headers': ''
|
||||
}
|
||||
};
|
||||
headers: {
|
||||
'Access-Control-Request-Headers': ''
|
||||
}
|
||||
};
|
||||
|
||||
self._request(options, function(err, res) {
|
||||
if (res && res.length > 0) {
|
||||
all = all.concat(res);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, function() {
|
||||
self._request(options, function(err, res) {
|
||||
if (res && res.length > 0) {
|
||||
all = all.concat(res);
|
||||
}
|
||||
return cb(all);
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ angular.module('copay.controllerUtils')
|
|||
};
|
||||
|
||||
root.updateBalance = function(cb) {
|
||||
root.setSocketHandlers();
|
||||
$rootScope.balanceByAddr = {};
|
||||
var w = $rootScope.wallet;
|
||||
$rootScope.addrInfos = w.getAddressesInfo();
|
||||
|
|
@ -118,6 +117,7 @@ angular.module('copay.controllerUtils')
|
|||
$rootScope.loading = false;
|
||||
if (cb) cb();
|
||||
});
|
||||
root.setSocketHandlers();
|
||||
};
|
||||
|
||||
root.setSocketHandlers = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue