From d98136e8504b3762e07f57f90b13a488792d843a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 8 Aug 2023 20:21:32 -0700 Subject: [PATCH] funding: add support for implicit negotiation for taproot chans Otherwise, in the itests (which are mainly based on implicit negotiation), we won't try to open taproot chans when we actually need to. We may want to revisit this however, since it may lock in parties trying to use the defaults that aren't currently setting the explicit commit type during funding. --- funding/commitment_type_negotiation.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/funding/commitment_type_negotiation.go b/funding/commitment_type_negotiation.go index 43774093b..e88d91258 100644 --- a/funding/commitment_type_negotiation.go +++ b/funding/commitment_type_negotiation.go @@ -302,6 +302,16 @@ func implicitNegotiateCommitmentType(local, remote *lnwire.FeatureVector) (*lnwire.ChannelType, lnwallet.CommitmentType) { + // If both peers are signalling support for taproot chanenls, then + // we'll use that type. + if hasFeatures(local, remote, lnwire.SimpleTaprootChannelsOptional) { + chanType := lnwire.ChannelType(*lnwire.NewRawFeatureVector( + lnwire.SimpleTaprootChannelsRequired, + )) + + return &chanType, lnwallet.CommitmentTypeSimpleTaproot + } + // If both peers are signalling support for anchor commitments with // zero-fee HTLC transactions, we'll use this type. if hasFeatures(local, remote, lnwire.AnchorsZeroFeeHtlcTxOptional) {