Skip to content

Commit

Permalink
Merge branch 'master' into use-common-interface-for-export-files
Browse files Browse the repository at this point in the history
  • Loading branch information
chowbao authored Feb 20, 2024
2 parents b91ba3f + a3f75f7 commit 45c8fed
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/input/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ func GetTransactions(start, end uint32, limit int64, env utils.EnvironmentDetail
err = backend.PrepareRange(ctx, ledgerbackend.BoundedRange(start, end))
panicIf(err)
for seq := start; seq <= end; seq++ {
txReader, err := ingest.NewLedgerTransactionReader(ctx, backend, env.NetworkPassphrase, seq)
ledgerCloseMeta, err := backend.GetLedger(ctx, seq)
if err != nil {
return nil, errors.Wrap(err, "error getting ledger from the backend")
}

txReader, err := ingest.NewLedgerTransactionReaderFromLedgerCloseMeta(env.NetworkPassphrase, ledgerCloseMeta)
if err != nil {
return []LedgerTransformInput{}, err
}

lhe := txReader.GetHeader()

ledgerCloseMeta, err := backend.GetLedger(ctx, seq)
if err != nil {
return nil, errors.Wrap(err, "error getting ledger from the backend")
}
// A negative limit value means that all input should be processed
for int64(len(txSlice)) < limit || limit < 0 {
tx, err := txReader.Read()
Expand Down

0 comments on commit 45c8fed

Please sign in to comment.