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 = [];
|
var all = [];
|
||||||
|
|
||||||
_asyncForEach(addresses, function(addr, callback) {
|
var options = {
|
||||||
var options = {
|
host: self.host,
|
||||||
host: self.host,
|
port: self.port,
|
||||||
port: self.port,
|
scheme: self.scheme,
|
||||||
scheme: self.scheme,
|
method: 'GET',
|
||||||
method: 'GET',
|
path: '/api/addrs/' + addresses.join(',') + '/utxo',
|
||||||
path: '/api/addr/' + addr + '/utxo',
|
|
||||||
|
|
||||||
headers: {
|
headers: {
|
||||||
'Access-Control-Request-Headers': ''
|
'Access-Control-Request-Headers': ''
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
self._request(options, function(err, res) {
|
self._request(options, function(err, res) {
|
||||||
if (res && res.length > 0) {
|
if (res && res.length > 0) {
|
||||||
all = all.concat(res);
|
all = all.concat(res);
|
||||||
}
|
}
|
||||||
callback();
|
|
||||||
});
|
|
||||||
}, function() {
|
|
||||||
return cb(all);
|
return cb(all);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@ angular.module('copay.controllerUtils')
|
||||||
};
|
};
|
||||||
|
|
||||||
root.updateBalance = function(cb) {
|
root.updateBalance = function(cb) {
|
||||||
root.setSocketHandlers();
|
|
||||||
$rootScope.balanceByAddr = {};
|
$rootScope.balanceByAddr = {};
|
||||||
var w = $rootScope.wallet;
|
var w = $rootScope.wallet;
|
||||||
$rootScope.addrInfos = w.getAddressesInfo();
|
$rootScope.addrInfos = w.getAddressesInfo();
|
||||||
|
|
@ -118,6 +117,7 @@ angular.module('copay.controllerUtils')
|
||||||
$rootScope.loading = false;
|
$rootScope.loading = false;
|
||||||
if (cb) cb();
|
if (cb) cb();
|
||||||
});
|
});
|
||||||
|
root.setSocketHandlers();
|
||||||
};
|
};
|
||||||
|
|
||||||
root.setSocketHandlers = function() {
|
root.setSocketHandlers = function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue