lnwallet: add ChannelID method to LightningChannel

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.
This commit is contained in:
Keagan McClelland 2024-06-06 11:35:52 -07:00
parent a895b1c6ca
commit a89e24f487
No known key found for this signature in database
GPG Key ID: FA7E65C951F12439

View File

@ -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.