multi: let ForEachNodeChannel take a reset param

This commit is contained in:
Elle Mouton committed 2025-07-15 11:23:27 +02:00
1 parent 16126d7703
commit e5fbca8299
13 files changed
+57 -43

No files matched your search

+10 -2
View File
@@ -7048,7 +7048,8 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
channels []*lnrpc.ChannelEdge
)
err = graph.ForEachNodeChannel(ctx, node.PubKeyBytes,
err = graph.ForEachNodeChannel(
ctx, node.PubKeyBytes,
func(edge *models.ChannelEdgeInfo,
c1, c2 *models.ChannelEdgePolicy) error {
@@ -7074,6 +7075,10 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
}
return nil
}, func() {
numChannels = 0
totalCapacity = 0
channels = nil
},
)
if err != nil {
@@ -7730,7 +7735,8 @@ func (r *rpcServer) FeeReport(ctx context.Context,
}
var feeReports []*lnrpc.ChannelFeeReport
err = channelGraph.ForEachNodeChannel(ctx, selfNode.PubKeyBytes,
err = channelGraph.ForEachNodeChannel(
ctx, selfNode.PubKeyBytes,
func(chanInfo *models.ChannelEdgeInfo,
edgePolicy, _ *models.ChannelEdgePolicy) error {
@@ -7768,6 +7774,8 @@ func (r *rpcServer) FeeReport(ctx context.Context,
})
return nil
}, func() {
feeReports = nil
},
)
if err != nil {