diff --git a/network/backend/lnd/lnd.go b/network/backend/lnd/lnd.go index 35ee23e..bf50c67 100644 --- a/network/backend/lnd/lnd.go +++ b/network/backend/lnd/lnd.go @@ -371,8 +371,8 @@ func (l Backend) GetChannelInfo(ctx context.Context, channel *models.Channel) er if err != nil { return errors.WithStack(err) } - if info != nil { - channel.WeFirst = resp.Node1Pub == info.IdentityPubkey + if info != nil && resp.Node1Pub != info.IdentityPubkey { + channel.Policy1, channel.Policy2 = channel.Policy2, channel.Policy1 } return nil diff --git a/network/models/channel.go b/network/models/channel.go index 973eac7..b57cbcf 100644 --- a/network/models/channel.go +++ b/network/models/channel.go @@ -49,7 +49,6 @@ type Channel struct { PendingHTLC []*HTLC LastUpdate *time.Time Node *Node - WeFirst bool Policy1 *RoutingPolicy Policy2 *RoutingPolicy } diff --git a/ui/views/channel.go b/ui/views/channel.go index 95297b0..39568da 100644 --- a/ui/views/channel.go +++ b/ui/views/channel.go @@ -230,17 +230,14 @@ func (c *Channel) display() { } } - if channel.Policy1 != nil && channel.WeFirst { + if channel.Policy1 != nil { printPolicy(v, p, channel.Policy1, true) } if channel.Policy2 != nil { - printPolicy(v, p, channel.Policy2, !channel.WeFirst) + printPolicy(v, p, channel.Policy2, false) } - if channel.Policy1 != nil && !channel.WeFirst { - printPolicy(v, p, channel.Policy1, false) - } if len(channel.PendingHTLC) > 0 { fmt.Fprintln(v) fmt.Fprintln(v, green(" [ Pending HTLCs ]"))