From 9342a8d27df554d9edf681e209c8342006dbc205 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 2 Dec 2017 18:42:12 -0800 Subject: [PATCH] cmd/lncli: add color border to graph rendering if node's color is set --- cmd/lncli/commands.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index eadf3e23..f8c1cf3d 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -1429,7 +1429,13 @@ func drawChannelGraph(graph *lnrpc.ChannelGraph) error { // TODO(roasbeef): should be able to get around this? nodeID := fmt.Sprintf(`"%v"`, truncateStr(node.PubKey, numKeyChars)) - graphCanvas.AddNode(graphName, nodeID, gographviz.Attrs{}) + attrs := gographviz.Attrs{} + + if node.Color != "" { + attrs["color"] = fmt.Sprintf(`"%v"`, node.Color) + } + + graphCanvas.AddNode(graphName, nodeID, attrs) } normalize := normalizeFunc(graph.Edges, 3)