Skip to content

Commit

Permalink
stellar#4430: increment tx order num in all cases for each ledger rea…
Browse files Browse the repository at this point in the history
…d operation
  • Loading branch information
sreuland committed Jun 23, 2022
1 parent d5e26e5 commit a5a8b83
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions exp/lighthorizon/archive/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func (a *Wrapper) GetOperations(cursor int64, limit int64) ([]common.Operation,

for operationOrder := range tx.Envelope.Operations() {
currID := toid.New(int32(ledgerSequence), transactionOrder+1, int32(operationOrder+1)).ToInt64()
transactionOrder++

if currID >= cursor {
appending = true
Expand All @@ -93,8 +94,6 @@ func (a *Wrapper) GetOperations(cursor int64, limit int64) ([]common.Operation,
return ops, nil
}
}

transactionOrder++
}

ledgerSequence++
Expand Down Expand Up @@ -137,6 +136,7 @@ func (a *Wrapper) GetTransactions(ctx context.Context, cursor int64, limit int64
}

currID := toid.New(int32(ledgerSequence), transactionOrder+1, 1).ToInt64()
transactionOrder++

if currID >= cursor {
appending = true
Expand All @@ -162,7 +162,6 @@ func (a *Wrapper) GetTransactions(ctx context.Context, cursor int64, limit int64
if ctx.Err() != nil {
return nil, ctx.Err()
}
transactionOrder++
}

ledgerSequence++
Expand Down

0 comments on commit a5a8b83

Please sign in to comment.