addressSummarySubQuery: API chain-query
- Adding support for API chain-query for addresses with lot of txs
This commit is contained in:
parent
285ccb1471
commit
503eaf70cf
@ -97,14 +97,22 @@ AddressController.prototype.unconfirmedBalance = function(req, res) {
|
|||||||
AddressController.prototype.addressSummarySubQuery = function(req, res, param) {
|
AddressController.prototype.addressSummarySubQuery = function(req, res, param) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var options = { noTxList: true };
|
var options = { noTxList: true };
|
||||||
|
|
||||||
|
if (req.query.after) {
|
||||||
|
options.after = req.query.after;
|
||||||
|
}
|
||||||
|
|
||||||
self.common.bindStopFlagOnClose(res, options);
|
self.common.bindStopFlagOnClose(res, options);
|
||||||
|
|
||||||
self.getAddressSummary(req.addr, options, function(err, data) {
|
self._address.getAddressSummary(req.addr, options, function(err, data) {
|
||||||
if(err) {
|
if(err) {
|
||||||
return self.common.handleErrors(err, res);
|
return self.common.handleErrors(err, res);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.jsonp(data[param]);
|
if(data.incomplete)
|
||||||
|
res.jsonp({lastItem: data.lastItem, data: data[param]});
|
||||||
|
else
|
||||||
|
res.jsonp(data[param]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user