mirror of
https://github.com/Xahau/xahau.js.git
synced 2026-06-09 11:46:42 +00:00
Set default max ledger to -1 when requesting account_tx
-1 means up to the most recent available _validated_ ledger for ledger_index_max account_tx operates only on valided ledgers
This commit is contained in:
@@ -70,7 +70,9 @@ function formatPartialResponse(address, options, data) {
|
||||
function getAccountTx(remote, address, options, marker, limit, callback) {
|
||||
const params = {
|
||||
account: address,
|
||||
// -1 is equivalent to earliest available validated ledger
|
||||
ledger_index_min: options.minLedgerVersion || -1,
|
||||
// -1 is equivalent to most recent available validated ledger
|
||||
ledger_index_max: options.maxLedgerVersion || -1,
|
||||
forward: options.earliestFirst,
|
||||
binary: options.binary,
|
||||
@@ -121,7 +123,7 @@ function getTransactionsAsync(account, options, callback) {
|
||||
validate.address(account);
|
||||
validate.getTransactionsOptions(options);
|
||||
|
||||
const defaults = {maxLedgerVersion: this.remote.getLedgerSequence()};
|
||||
const defaults = {maxLedgerVersion: -1};
|
||||
if (options.start) {
|
||||
getTransaction.call(this, options.start).then(tx => {
|
||||
const ledgerVersion = tx.outcome.ledgerVersion;
|
||||
|
||||
Reference in New Issue
Block a user