Merge pull request #8960 from lightningnetwork/0-19-staging-rebased

[custom channels 5/5]: merge custom channel staging branch into master
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2024-10-03 10:07:16 -07:00
commit 2d333178c3
56 files changed
+2283 -901

No files matched your search

+27
View File
@@ -2309,6 +2309,29 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
*channelType = lnwire.ChannelType(*fv)
case lnrpc.CommitmentType_SIMPLE_TAPROOT_OVERLAY:
// If the taproot overlay channel type is being set, then the
// channel MUST be private.
if !in.Private {
return nil, fmt.Errorf("taproot overlay channels " +
"must be private")
}
channelType = new(lnwire.ChannelType)
fv := lnwire.NewRawFeatureVector(
lnwire.SimpleTaprootOverlayChansRequired,
)
if in.ZeroConf {
fv.Set(lnwire.ZeroConfRequired)
}
if in.ScidAlias {
fv.Set(lnwire.ScidAliasRequired)
}
*channelType = lnwire.ChannelType(*fv)
default:
return nil, fmt.Errorf("unhandled request channel type %v",
in.CommitmentType)
@@ -4533,6 +4556,9 @@ func rpcCommitmentType(chanType channeldb.ChannelType) lnrpc.CommitmentType {
// first check whether it has anchors, since in that case it would also
// be tweakless.
switch {
case chanType.HasTapscriptRoot():
return lnrpc.CommitmentType_SIMPLE_TAPROOT_OVERLAY
case chanType.IsTaproot():
return lnrpc.CommitmentType_SIMPLE_TAPROOT
@@ -4544,6 +4570,7 @@ func rpcCommitmentType(chanType channeldb.ChannelType) lnrpc.CommitmentType {
case chanType.IsTweakless():
return lnrpc.CommitmentType_STATIC_REMOTE_KEY
default:
return lnrpc.CommitmentType_LEGACY