-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[8/?] - lncli+lnrpc: add support for creating unadvertised taproot channels #7347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9348aeb
22f6028
1606f06
7598dae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2121,11 +2121,39 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest, | |
|
|
||
| *channelType = lnwire.ChannelType(*fv) | ||
|
|
||
| case lnrpc.CommitmentType_SIMPLE_TAPROOT: | ||
| // If the taproot channel type is being set, then the channel | ||
| // MUST be private (unadvertised) for now. | ||
| if !in.Private { | ||
| return nil, fmt.Errorf("taproot channels must be " + | ||
| "private") | ||
| } | ||
|
|
||
| channelType = new(lnwire.ChannelType) | ||
| fv := lnwire.NewRawFeatureVector( | ||
| lnwire.SimpleTaprootChannelsRequired, | ||
| ) | ||
|
|
||
| // TODO(roasbeef): no need for the rest as they're now | ||
| // implicit? | ||
|
|
||
|
Comment on lines
+2137
to
+2139
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. are they? cant I want to support taproot chans but not want zero conf chans? |
||
| 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) | ||
| } | ||
|
|
||
| // TODO(roasbeef): make taproot the default chan type? | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps we should wait a bit & give users ample warning that we will switch the default type?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep won't be the default type for a looong time |
||
|
|
||
| // Instruct the server to trigger the necessary events to attempt to | ||
| // open a new channel. A stream is returned in place, this stream will | ||
| // be used to consume updates of the state of the pending channel. | ||
|
|
@@ -4058,19 +4086,22 @@ func rpcCommitmentType(chanType channeldb.ChannelType) lnrpc.CommitmentType { | |
| // Extract the commitment type from the channel type flags. We must | ||
| // first check whether it has anchors, since in that case it would also | ||
| // be tweakless. | ||
| if chanType.HasLeaseExpiration() { | ||
| switch { | ||
| case chanType.IsTaproot(): | ||
| return lnrpc.CommitmentType_SIMPLE_TAPROOT | ||
|
|
||
| case chanType.HasLeaseExpiration(): | ||
| return lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE | ||
| } | ||
|
|
||
| if chanType.HasAnchors() { | ||
| case chanType.HasAnchors(): | ||
| return lnrpc.CommitmentType_ANCHORS | ||
| } | ||
|
|
||
| if chanType.IsTweakless() { | ||
| case chanType.IsTweakless(): | ||
| return lnrpc.CommitmentType_STATIC_REMOTE_KEY | ||
| } | ||
| default: | ||
|
|
||
| return lnrpc.CommitmentType_LEGACY | ||
| return lnrpc.CommitmentType_LEGACY | ||
| } | ||
| } | ||
|
|
||
| // createChannelConstraint creates a *lnrpc.ChannelConstraints using the | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.