Auditing the ledger number on an XRPL payment record

A payment database stores both the transaction hash and the ledger number. Looking up the hash alone leaves a bad ledger reference undetected. A lookup scoped to one ledger tests the pair.

Query the exact pair from the record

Send this historical example over WebSocket to an endpoint that retains ledger 56865245. In your own audit substitute both fields from the same database row. Preserve the ledger hash returned with a successful lookup. Check the transaction metadata before classifying the payment outcome, since inclusion alone does not tell you whether execution succeeded.

{"command":"transaction_entry","ledger_index":56865245,"tx_hash":"C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9","api_version":2}

Separate a stale reference from missing history

If the node returns transactionNotFound, search the hash with the broader tx method on a backend covering the expected period. A result at another height gives you a concrete reference to investigate. If transaction_entry returns lgrNotFound, the backend cannot provide that ledger. Repeat the scoped lookup on a suitable archive before deciding that a stored payment row is wrong.

xrpl.org transaction_entry