Check for ledger gaps in getTransactions

This commit is contained in:
Chris Clark
2015-07-09 14:28:42 -07:00
parent 6a3eb7b9b9
commit 11ca00bb45
11 changed files with 30 additions and 24 deletions

View File

@@ -71,12 +71,20 @@ function compareTransactions(first, second) {
return Number(first.ledgerVersion) < Number(second.ledgerVersion) ? -1 : 1;
}
function hasCompleteLedgerRange(remote, minLedgerVersion, maxLedgerVersion) {
const firstLedgerVersion = 32570; // earlier versions have been lost
return remote.getServer().hasLedgerRange(
minLedgerVersion || firstLedgerVersion,
maxLedgerVersion || remote.getLedgerSequence());
}
module.exports = {
getXRPBalance: getXRPBalance,
compareTransactions: compareTransactions,
renameCounterpartyToIssuer: renameCounterpartyToIssuer,
renameCounterpartyToIssuerInOrder: renameCounterpartyToIssuerInOrder,
getRecursive: getRecursive,
getXRPBalance,
compareTransactions,
renameCounterpartyToIssuer,
renameCounterpartyToIssuerInOrder,
getRecursive,
hasCompleteLedgerRange,
wrapCatch: common.wrapCatch,
common: common
};