From 5f9c1b902f8f824a6beceacb9541b3e20838b0cf Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 10 Jun 2022 11:14:54 -0700 Subject: [PATCH] lnwire+feature: add awareness of option_shutdown_anysegwit In this commit, we add awareness of the option_shutdown_anysegwit that permits both sides to send newer segwit based addresses. This'll eventually enable us to send taproot addresses for co-op close. --- feature/default_sets.go | 4 ++++ lnwire/features.go | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/feature/default_sets.go b/feature/default_sets.go index 7956f6932..1b1fd1f10 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -79,4 +79,8 @@ var defaultSetDesc = setDesc{ SetInit: {}, // I SetNodeAnn: {}, // N }, + lnwire.ShutdownAnySegwitOptional: { + SetInit: {}, // I + SetNodeAnn: {}, // N + }, } diff --git a/lnwire/features.go b/lnwire/features.go index 55ee5bd10..c386fd37b 100644 --- a/lnwire/features.go +++ b/lnwire/features.go @@ -129,6 +129,18 @@ const ( // transactions, which also imply anchor commitments. AnchorsZeroFeeHtlcTxOptional FeatureBit = 23 + // ShutdownAnySegwitRequired is an required feature bit that signals + // that the sender is able to properly handle/parse segwit witness + // programs up to version 16. This enables utilization of Taproot + // addresses for cooperative closure addresses. + ShutdownAnySegwitRequired FeatureBit = 26 + + // ShutdownAnySegwitOptional is an optional feature bit that signals + // that the sender is able to properly handle/parse segwit witness + // programs up to version 16. This enables utilization of Taproot + // addresses for cooperative closure addresses. + ShutdownAnySegwitOptional FeatureBit = 27 + // AMPRequired is a required feature bit that signals that the receiver // of a payment supports accepts spontaneous payments, i.e. // sender-generated preimages according to BOLT XX. @@ -266,6 +278,8 @@ var Features = map[FeatureBit]string{ ScidAliasOptional: "scid-alias", ZeroConfRequired: "zero-conf", ZeroConfOptional: "zero-conf", + ShutdownAnySegwitRequired: "shutdown-any-segwit", + ShutdownAnySegwitOptional: "shutdown-any-segwit", } // RawFeatureVector represents a set of feature bits as defined in BOLT-09. A