mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Merge pull request #417 from darkdarkdragon/develop-fix-gettransaction-missing-history
throw MissingLedgerHistoryError in getTransaction only when ledgers a…
This commit is contained in:
@@ -39,11 +39,13 @@ function getTransaction(identifier, options, callback) {
|
||||
validate.getTransactionOptions(options);
|
||||
|
||||
const remote = this.remote;
|
||||
const maxLedgerVersion = Math.min(options.maxLedgerVersion,
|
||||
remote.getLedgerSequence());
|
||||
|
||||
function callbackWrapper(error, tx) {
|
||||
if (error instanceof errors.NotFoundError
|
||||
&& !utils.hasCompleteLedgerRange(remote,
|
||||
options.minLedgerVersion, options.maxLedgerVersion)) {
|
||||
options.minLedgerVersion, maxLedgerVersion)) {
|
||||
callback(new errors.MissingLedgerHistoryError('Transaction not found,'
|
||||
+ ' but the server\'s ledger history is incomplete'));
|
||||
} else if (!error && !isTransactionInRange(tx, options)) {
|
||||
|
||||
Reference in New Issue
Block a user