mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-11 22:57:59 +01:00
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:
@@ -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