cmd/lncli: fix graph rendering with a single channel
This commit is contained in:
parent
9342a8d27d
commit
c00a3ae03b
@ -1466,6 +1466,12 @@ func drawChannelGraph(graph *lnrpc.ChannelGraph) error {
|
|||||||
normalizedCapacity := normalize(edge.Capacity)
|
normalizedCapacity := normalize(edge.Capacity)
|
||||||
edgeThickness := strconv.FormatFloat(normalizedCapacity, 'f', -1, 64)
|
edgeThickness := strconv.FormatFloat(normalizedCapacity, 'f', -1, 64)
|
||||||
|
|
||||||
|
// If there's only a single channel in the graph, then we'll
|
||||||
|
// just set the edge thickness to 1 for everything.
|
||||||
|
if math.IsNaN(normalizedCapacity) {
|
||||||
|
edgeThickness = "1"
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): color code based on percentile capacity
|
// TODO(roasbeef): color code based on percentile capacity
|
||||||
graphCanvas.AddEdge(src, dest, false, gographviz.Attrs{
|
graphCanvas.AddEdge(src, dest, false, gographviz.Attrs{
|
||||||
"penwidth": edgeThickness,
|
"penwidth": edgeThickness,
|
||||||
|
@ -2100,7 +2100,10 @@ func testMultiHopPayments(net *networkHarness, t *harnessTest) {
|
|||||||
err)
|
err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Using Carol as the source, pay to the 5 invoices from Bob created above.
|
time.Sleep(time.Millisecond * 50)
|
||||||
|
|
||||||
|
// Using Carol as the source, pay to the 5 invoices from Bob created
|
||||||
|
// above.
|
||||||
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
ctxt, _ = context.WithTimeout(ctxb, timeout)
|
||||||
err = completePaymentRequests(ctxt, carol, payReqs, true)
|
err = completePaymentRequests(ctxt, carol, payReqs, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user