Skip to content

Commit

Permalink
use multi epoch (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjor authored Nov 21, 2024
1 parent ef02393 commit 272e6b1
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions multiepoch-getSignaturesForAddress.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (ser *MultiEpoch) getGsfaReadersInEpochDescendingOrder() ([]*gsfa.GsfaReade
}

// getGsfaReadersInEpochDescendingOrder returns a list of gsfa readers in epoch order (from most recent to oldest).
func (ser *MultiEpoch) getGsfaReadersInEpochDescendingOrderForSlotRange(ctx context.Context, startSlot, endSlot uint64) ([]*gsfa.GsfaReader, []uint64) {
func (ser *MultiEpoch) getGsfaReadersInEpochDescendingOrderForSlotRange(ctx context.Context, startSlot, endSlot uint64) (*gsfa.GsfaReaderMultiepoch, []uint64) {
ser.mu.RLock()
defer ser.mu.RUnlock()

Expand Down Expand Up @@ -72,7 +72,15 @@ func (ser *MultiEpoch) getGsfaReadersInEpochDescendingOrderForSlotRange(ctx cont
epochNums = append(epochNums, epoch.Epoch())
}
}
return gsfaReaders, epochNums

gsfaReaderMultiEpoch, err := gsfa.NewGsfaReaderMultiepoch(gsfaReaders)
if err != nil {
klog.Errorf("failed to construct gsfaReaderMultiEpoch: %w", err)
return nil, nil
}

return gsfaReaderMultiEpoch, epochNums

}

func countTransactions(v gsfa.EpochToTransactionObjects) int {
Expand Down

0 comments on commit 272e6b1

Please sign in to comment.