multi+refactor: create ForEachNodeChannel with no tx param

In prep for a clean Graph DB interface, we add a version of
ForEachNodeChannel that does not take in an existing db transaction.
This commit is contained in:
Elle Mouton
2024-06-14 20:34:53 -04:00
parent c20d759d41
commit e9c89ae0ec
6 changed files with 28 additions and 12 deletions

View File

@@ -6361,7 +6361,7 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
channels []*lnrpc.ChannelEdge
)
err = graph.ForEachNodeChannel(nil, node.PubKeyBytes,
err = graph.ForEachNodeChannel(node.PubKeyBytes,
func(_ kvdb.RTx, edge *models.ChannelEdgeInfo,
c1, c2 *models.ChannelEdgePolicy) error {
@@ -7014,7 +7014,7 @@ func (r *rpcServer) FeeReport(ctx context.Context,
}
var feeReports []*lnrpc.ChannelFeeReport
err = channelGraph.ForEachNodeChannel(nil, selfNode.PubKeyBytes,
err = channelGraph.ForEachNodeChannel(selfNode.PubKeyBytes,
func(_ kvdb.RTx, chanInfo *models.ChannelEdgeInfo,
edgePolicy, _ *models.ChannelEdgePolicy) error {