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
2023-08-17 16:16:15 -07:00
parent 4b65c71213
commit dd05dd55d4

View File

@ -286,6 +286,24 @@ func explicitNegotiateCommitmentType(channelType lnwire.ChannelType, local,
return lnwallet.CommitmentTypeSimpleTaproot, nil 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. // No features, use legacy commitment type.
case channelFeatures.IsEmpty(): case channelFeatures.IsEmpty():
return lnwallet.CommitmentTypeLegacy, nil return lnwallet.CommitmentTypeLegacy, nil