graph/db: convert ChanUpdatesInHorizon to use iterators
In this commit, we refactor the ChanUpdatesInHorizon method to return an iterator instead of a slice. This change significantly reduces memory usage when dealing with large result sets by allowing callers to process items incrementally rather than loading everything into memory at once.
This commit is contained in:
7 files changed
+254
-86
No files matched your search
@@ -220,8 +220,8 @@ type V1Store interface { //nolint:interfacebloat
|
||||
// ChanUpdatesInHorizon returns all the known channel edges which have
|
||||
// at least one edge that has an update timestamp within the specified
|
||||
// horizon.
|
||||
ChanUpdatesInHorizon(startTime, endTime time.Time) ([]ChannelEdge,
|
||||
error)
|
||||
ChanUpdatesInHorizon(startTime, endTime time.Time,
|
||||
opts ...IteratorOption) (iter.Seq[ChannelEdge], error)
|
||||
|
||||
// FilterKnownChanIDs takes a set of channel IDs and return the subset
|
||||
// of chan ID's that we don't know and are not known zombies of the
|
||||
|
||||
Reference in new issue
Block a user