lnwallet: expose channel state

We create a deep copy of the channel state as we want to later expose
the data structure to the rpc, which already has helper methods to
marshal this representation to the rpc representation.
This commit is contained in:
bitromortac committed 2026-02-20 10:43:52 +01:00
1 parent 78b2036f39
commit 19860bb9f6
2 files changed
+106

No files matched your search

+7
View File
@@ -6576,6 +6576,13 @@ func (lc *LightningChannel) ChannelPoint() wire.OutPoint {
return lc.channelState.FundingOutpoint
}
// ChannelState returns a copy of the internal channeldb.OpenChannel state
// struct. Modifications to the returned struct will not be reflected within
// the LightningChannel.
func (lc *LightningChannel) ChannelState() *channeldb.OpenChannel {
return lc.channelState.Copy()
}
// 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 {