Skip to content

Commit

Permalink
lnwallet: add ChannelID method to LightningChannel
Browse files Browse the repository at this point in the history
In this commit we introduce a convenience method to LightningChannel
to allow us to quickly grab the channel id. This will be important
in upcoming commits where we need to remember the ChannelID to
reconstruct update messages.
  • Loading branch information
ProofOfKeags committed Sep 9, 2024
1 parent a895b1c commit a89e24f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lnwallet/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6327,6 +6327,12 @@ func (lc *LightningChannel) ChannelPoint() wire.OutPoint {
return lc.channelState.FundingOutpoint
}

// ChannelID returns the ChannelID of this LightningChannel. This is the same
// ChannelID that is used in update messages for this channel.
func (lc *LightningChannel) ChannelID() lnwire.ChannelID {
return lnwire.NewChanIDFromOutPoint(lc.ChannelPoint())
}

// ShortChanID returns the short channel ID for the channel. The short channel
// ID encodes the exact location in the main chain that the original
// funding output can be found.
Expand Down

0 comments on commit a89e24f

Please sign in to comment.