rpcserver: conditionally include channels in GetNodeInfoResponse
This commit is contained in:
1 file changed
+13
-8
+13
-8
@@ -3821,15 +3821,20 @@ func (r *rpcServer) GetNodeInfo(ctx context.Context,
|
|||||||
numChannels++
|
numChannels++
|
||||||
totalCapacity += edge.Capacity
|
totalCapacity += edge.Capacity
|
||||||
|
|
||||||
// Do not include unannounced channels - private channels or public
|
// Only populate the node's channels if the user requested them.
|
||||||
// channels whose authentication proof were not confirmed yet.
|
if in.IncludeChannels {
|
||||||
if edge.AuthProof == nil {
|
// Do not include unannounced channels - private
|
||||||
return nil
|
// channels or public channels whose authentication
|
||||||
}
|
// proof were not confirmed yet.
|
||||||
|
if edge.AuthProof == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// Convert the database's edge format into the network/RPC edge format.
|
// Convert the database's edge format into the
|
||||||
channelEdge := marshalDbEdge(edge, c1, c2)
|
// network/RPC edge format.
|
||||||
channels = append(channels, channelEdge)
|
channelEdge := marshalDbEdge(edge, c1, c2)
|
||||||
|
channels = append(channels, channelEdge)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user