multi: reset for ForEachNodeDirectedChannel

This commit is contained in:
Elle Mouton committed 2025-07-15 11:25:10 +02:00
1 parent 13d0bd5ef6
commit 83f6dc4983
10 files changed
+62 -29

No files matched your search

+6 -4
View File
@@ -63,16 +63,18 @@ func newBandwidthManager(graph Graph, sourceNode route.Vertex,
// First, we'll collect the set of outbound edges from the target
// source node and add them to our bandwidth manager's map of channels.
err := graph.ForEachNodeDirectedChannel(sourceNode,
func(channel *graphdb.DirectedChannel) error {
err := graph.ForEachNodeDirectedChannel(
sourceNode, func(channel *graphdb.DirectedChannel) error {
shortID := lnwire.NewShortChanIDFromInt(
channel.ChannelID,
)
manager.localChans[shortID] = struct{}{}
return nil
})
}, func() {
clear(manager.localChans)
},
)
if err != nil {
return nil, err
}