Skip to content

Commit 11a04e6

Browse files
committed
lndclient: add initiator, private and uptime fields to listchannels
1 parent 0d67b39 commit 11a04e6

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

lndclient/lightning_client.go

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ type Info struct {
7171

7272
// ChannelInfo stores unpacked per-channel info.
7373
type ChannelInfo struct {
74-
// Active indecates whether the channel is active.
74+
// ChannelPoint is the funding outpoint of the channel.
75+
ChannelPoint string
76+
77+
// Active indicates whether the channel is active.
7578
Active bool
7679

7780
// ChannelID holds the unique channel ID for the channel. The first 3 bytes
@@ -90,6 +93,20 @@ type ChannelInfo struct {
9093

9194
// RemoteBalance is the counterparty's current balance in this channel.
9295
RemoteBalance btcutil.Amount
96+
97+
// Initiator indicates whether we opened the channel or not.
98+
Initiator bool
99+
100+
// Private indicates that the channel is private.
101+
Private bool
102+
103+
// LifeTime is the total amount of time we have monitored the peer's
104+
// online status for.
105+
LifeTime time.Duration
106+
107+
// Uptime is the total amount of time the peer has been observed as
108+
// online over its lifetime.
109+
Uptime time.Duration
93110
}
94111

95112
var (
@@ -545,12 +562,21 @@ func (s *lightningClient) ListChannels(ctx context.Context) (
545562
}
546563

547564
result[i] = ChannelInfo{
565+
ChannelPoint: channel.ChannelPoint,
548566
Active: channel.Active,
549567
ChannelID: channel.ChanId,
550568
PubKeyBytes: remoteVertex,
551569
Capacity: btcutil.Amount(channel.Capacity),
552570
LocalBalance: btcutil.Amount(channel.LocalBalance),
553571
RemoteBalance: btcutil.Amount(channel.RemoteBalance),
572+
Initiator: channel.Initiator,
573+
Private: channel.Private,
574+
LifeTime: time.Second * time.Duration(
575+
channel.Lifetime,
576+
),
577+
Uptime: time.Second * time.Duration(
578+
channel.Uptime,
579+
),
554580
}
555581
}
556582

0 commit comments

Comments
 (0)