lnwallet: expose commitment blob from channel

This commit is contained in:
George Tsagkarelis authored and Oliver Gugger committed 2024-09-05 11:18:17 +02:00
1 parent afdceab400
commit 5cb68a59c5
1 file changed
+16
+16
View File
@@ -9119,3 +9119,19 @@ func (lc *LightningChannel) MultiSigKeys() (keychain.KeyDescriptor,
return lc.channelState.LocalChanCfg.MultiSigKey,
lc.channelState.RemoteChanCfg.MultiSigKey
}
// LocalCommitmentBlob returns the custom blob of the local commitment.
func (lc *LightningChannel) LocalCommitmentBlob() fn.Option[tlv.Blob] {
lc.RLock()
defer lc.RUnlock()
chanState := lc.channelState
localBalance := chanState.LocalCommitment.CustomBlob
return fn.MapOption(func(b tlv.Blob) tlv.Blob {
newBlob := make([]byte, len(b))
copy(newBlob, b)
return newBlob
})(localBalance)
}