From 03b35d000e8519c02e8a6fcfd1ac6dd240941320 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Fri, 23 May 2025 13:54:19 -0700 Subject: [PATCH] peer+feature: start to signal the prod rbf coop close bit In this commit, we start to signal the prod bit for the rbf coop close feature. We keep our signaling of the staging bit in place to ensure the protocol continues to work between those nodes in the wild that are still signaling the bit. Fixes https://github.com/lightningnetwork/lnd/issues/9852 --- feature/default_sets.go | 4 ++++ feature/manager.go | 1 + peer/brontide.go | 12 +++++++----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/feature/default_sets.go b/feature/default_sets.go index 244466e86..fcb53b666 100644 --- a/feature/default_sets.go +++ b/feature/default_sets.go @@ -107,4 +107,8 @@ var defaultSetDesc = setDesc{ SetInit: {}, // I SetNodeAnn: {}, // N }, + lnwire.RbfCoopCloseOptional: { + SetInit: {}, // I + SetNodeAnn: {}, // N + }, } diff --git a/feature/manager.go b/feature/manager.go index ad26ac8ab..862880f3b 100644 --- a/feature/manager.go +++ b/feature/manager.go @@ -219,6 +219,7 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) { } if cfg.NoRbfCoopClose { raw.Unset(lnwire.RbfCoopCloseOptionalStaging) + raw.Unset(lnwire.RbfCoopCloseOptional) } for _, custom := range cfg.CustomFeatures[set] { diff --git a/peer/brontide.go b/peer/brontide.go index 17e9bc409..6d1864fb9 100644 --- a/peer/brontide.go +++ b/peer/brontide.go @@ -975,11 +975,13 @@ func (p *Brontide) taprootShutdownAllowed() bool { // rbfCoopCloseAllowed returns true if both parties have negotiated the new RBF // coop close feature. func (p *Brontide) rbfCoopCloseAllowed() bool { - return p.RemoteFeatures().HasFeature( - lnwire.RbfCoopCloseOptionalStaging, - ) && p.LocalFeatures().HasFeature( - lnwire.RbfCoopCloseOptionalStaging, - ) + bothHaveBit := func(bit lnwire.FeatureBit) bool { + return p.RemoteFeatures().HasFeature(bit) && + p.LocalFeatures().HasFeature(bit) + } + + return bothHaveBit(lnwire.RbfCoopCloseOptional) || + bothHaveBit(lnwire.RbfCoopCloseOptionalStaging) } // QuitSignal is a method that should return a channel which will be sent upon