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.
This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:34:20 -07:00
1 parent 4b65c71213
commit dd05dd55d4
1 file changed
+18
+18
View File
@@ -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