Skip to content

Commit

Permalink
use multi epoch (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjor committed Nov 30, 2024
1 parent 3c03033 commit 27f297a
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 27f297a

Please sign in to comment.