Get all results when limit is not specified

This commit is contained in:
Chris Clark
2015-07-08 15:13:20 -07:00
parent a464ca2368
commit f3a54bf02a
4 changed files with 14 additions and 13 deletions

View File

@@ -10,7 +10,7 @@ function requestAccountOffers(remote, address, ledgerVersion, options,
remote.requestAccountOffers({
account: address,
marker: marker,
limit: limit,
limit: utils.clamp(limit, 10, 400),
ledger: ledgerVersion
},
composeAsync((data) => ({
@@ -23,13 +23,11 @@ function getAccountOrders(account, options, callback) {
validate.address(account);
validate.options(options);
const defaultLimit = 100;
const limit = options.limit || defaultLimit;
const ledgerVersion = options.ledgerVersion
|| this.remote.getLedgerSequence();
const getter = _.partial(requestAccountOffers, this.remote, account,
ledgerVersion, options);
utils.getRecursive(getter, limit,
utils.getRecursive(getter, options.limit,
composeAsync((orders) => _.sortBy(orders,
(order) => order.properties.sequence), callback));
}