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.
This commit is contained in:
Olaoluwa Osuntokun 2023-08-08 20:21:32 -07:00
parent bed9455d60
commit d98136e850
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -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) {