mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-04 21:15:47 +00:00
Autofill: use current ledger for sequence number (#1719)
Getting an account's next available sequence number is a case where using the open ledger usually makes more sense than getting the validated ledger. If you have any transactions pending, the sequence from the validated ledger will be behind, but one from the open ledger will be correct unless the pending transactions fail to achieve a consensus (which is rare).
This commit is contained in:
@@ -127,7 +127,7 @@ async function setNextValidSequenceNumber(
|
||||
const request: AccountInfoRequest = {
|
||||
command: 'account_info',
|
||||
account: tx.Account,
|
||||
ledger_index: 'validated',
|
||||
ledger_index: 'current',
|
||||
}
|
||||
const data = await client.request(request)
|
||||
// eslint-disable-next-line no-param-reassign, require-atomic-updates -- param reassign is safe with no race condition
|
||||
|
||||
Reference in New Issue
Block a user