@@ -71,7 +71,10 @@ type Info struct {
71
71
72
72
// ChannelInfo stores unpacked per-channel info.
73
73
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.
75
78
Active bool
76
79
77
80
// ChannelID holds the unique channel ID for the channel. The first 3 bytes
@@ -90,6 +93,20 @@ type ChannelInfo struct {
90
93
91
94
// RemoteBalance is the counterparty's current balance in this channel.
92
95
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
93
110
}
94
111
95
112
var (
@@ -545,12 +562,21 @@ func (s *lightningClient) ListChannels(ctx context.Context) (
545
562
}
546
563
547
564
result [i ] = ChannelInfo {
565
+ ChannelPoint : channel .ChannelPoint ,
548
566
Active : channel .Active ,
549
567
ChannelID : channel .ChanId ,
550
568
PubKeyBytes : remoteVertex ,
551
569
Capacity : btcutil .Amount (channel .Capacity ),
552
570
LocalBalance : btcutil .Amount (channel .LocalBalance ),
553
571
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
+ ),
554
580
}
555
581
}
556
582
0 commit comments