Skip to content

Commit c73da86

Browse files
authored
Merge pull request #137 from GeorgeTsagk/add-chaninfo-zeroconf-scid
Add zeroconf and scids to `ChannelInfo`
2 parents 8200399 + 65161d9 commit c73da86

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lightning_client.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,16 @@ type ChannelInfo struct {
392392
// CloseAddr is the optional upfront shutdown address set for a
393393
// channel.
394394
CloseAddr btcutil.Address
395+
396+
// ZeroConf indicates whether the channel is a zero conf channel or not.
397+
ZeroConf bool
398+
399+
// ZeroConfScid is the confirmed on-chain zero-conf SCID.
400+
ZeroConfScid uint64
401+
402+
// AliasScids contains a list of alias short channel identifiers that
403+
// may be used for this channel. This array can be empty.
404+
AliasScids []uint64
395405
}
396406

397407
func (s *lightningClient) newChannelInfo(channel *lnrpc.Channel) (*ChannelInfo,
@@ -433,8 +443,13 @@ func (s *lightningClient) newChannelInfo(channel *lnrpc.Channel) (*ChannelInfo,
433443
RemoteConstraints: newChannelConstraint(
434444
channel.RemoteConstraints,
435445
),
446+
ZeroConf: channel.ZeroConf,
447+
ZeroConfScid: channel.ZeroConfConfirmedScid,
436448
}
437449

450+
chanInfo.AliasScids = make([]uint64, len(channel.AliasScids))
451+
copy(chanInfo.AliasScids, channel.AliasScids)
452+
438453
chanInfo.PendingHtlcs = make([]PendingHtlc, len(channel.PendingHtlcs))
439454
for i, rpcHtlc := range channel.PendingHtlcs {
440455
htlc, err := newPendingHtlc(rpcHtlc)

0 commit comments

Comments
 (0)