From dd05dd55d4299331df13632c0989dc5587e9f0f5 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 17 Aug 2023 16:16:15 -0700 Subject: [PATCH] funding: add explicit chan type support for zeroconf+scid+taproot We also remove the old implicit negotiation as well, as we'll be updating tests to use explciit when required. --- funding/commitment_type_negotiation.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/funding/commitment_type_negotiation.go b/funding/commitment_type_negotiation.go index e88d91258..ec25ce078 100644 --- a/funding/commitment_type_negotiation.go +++ b/funding/commitment_type_negotiation.go @@ -286,6 +286,24 @@ func explicitNegotiateCommitmentType(channelType lnwire.ChannelType, local, return lnwallet.CommitmentTypeSimpleTaproot, nil + // Simple taproot channels with scid and zero conf. + case channelFeatures.OnlyContains( + lnwire.SimpleTaprootChannelsRequired, + lnwire.ZeroConfRequired, + lnwire.ScidAliasRequired, + ): + + if !hasFeatures( + local, remote, + lnwire.SimpleTaprootChannelsOptional, + lnwire.ZeroConfOptional, + ) { + + return 0, errUnsupportedChannelType + } + + return lnwallet.CommitmentTypeSimpleTaproot, nil + // No features, use legacy commitment type. case channelFeatures.IsEmpty(): return lnwallet.CommitmentTypeLegacy, nil