From 9cd954380b730d6149ace50a9ad828289d8d5bc1 Mon Sep 17 00:00:00 2001 From: Edouard Paris Date: Thu, 21 Mar 2019 09:38:31 +0100 Subject: [PATCH] views channels: remove chartPubKey --- ui/views/channels.go | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/ui/views/channels.go b/ui/views/channels.go index 099a0e7..6c0002a 100644 --- a/ui/views/channels.go +++ b/ui/views/channels.go @@ -56,12 +56,11 @@ func (c *Channels) Set(g *gocui.Gui, x0, y0, x1, y1 int) error { } func displayChannelsHeader(v *gocui.View) { - fmt.Fprintln(v, fmt.Sprintf("%-9s %12s %12s %-64s %-19s", + fmt.Fprintln(v, fmt.Sprintf("%-9s %-19s %12s %12s", "status", + "id", "local", "capacity", - "pub_key", - "id", )) } @@ -94,12 +93,11 @@ func (c *Channels) update(ctx context.Context) error { func (c *Channels) display() { c.Clear() for _, item := range c.items { - line := fmt.Sprintf("%s %s %12d %s %s", + line := fmt.Sprintf("%s %s %s %12d", active(item), + chartID(item), color.Cyan(fmt.Sprintf("%12d", item.LocalBalance)), item.Capacity, - chartPubKey(item), - chartID(item), ) fmt.Fprintln(c.View, line) } @@ -126,14 +124,3 @@ func chartID(c *models.Channel) string { return buffer.String() } - -func chartPubKey(c *models.Channel) string { - pubkey := c.RemotePubKey - index := int(c.LocalBalance * int64(len(pubkey)) / c.Capacity) - - var buffer bytes.Buffer - buffer.WriteString(color.Cyan(pubkey[:index])) - buffer.WriteString(pubkey[index:]) - - return buffer.String() -}