Skip to content

Commit

Permalink
Remove WeFirst parameter altogether
Browse files Browse the repository at this point in the history
  • Loading branch information
rkfg committed Sep 14, 2022
1 parent a259019 commit 6c6372f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions network/backend/lnd/lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion network/models/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ type Channel struct {
PendingHTLC []*HTLC
LastUpdate *time.Time
Node *Node
WeFirst bool
Policy1 *RoutingPolicy
Policy2 *RoutingPolicy
}
Expand Down
7 changes: 2 additions & 5 deletions ui/views/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]"))
Expand Down

0 comments on commit 6c6372f

Please sign in to comment.