Skip to content

Commit 03b35d0

Browse files
committed
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 #9852
1 parent cbdd1c2 commit 03b35d0

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

feature/default_sets.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,8 @@ var defaultSetDesc = setDesc{
107107
SetInit: {}, // I
108108
SetNodeAnn: {}, // N
109109
},
110+
lnwire.RbfCoopCloseOptional: {
111+
SetInit: {}, // I
112+
SetNodeAnn: {}, // N
113+
},
110114
}

feature/manager.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
219219
}
220220
if cfg.NoRbfCoopClose {
221221
raw.Unset(lnwire.RbfCoopCloseOptionalStaging)
222+
raw.Unset(lnwire.RbfCoopCloseOptional)
222223
}
223224

224225
for _, custom := range cfg.CustomFeatures[set] {

peer/brontide.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,13 @@ func (p *Brontide) taprootShutdownAllowed() bool {
975975
// rbfCoopCloseAllowed returns true if both parties have negotiated the new RBF
976976
// coop close feature.
977977
func (p *Brontide) rbfCoopCloseAllowed() bool {
978-
return p.RemoteFeatures().HasFeature(
979-
lnwire.RbfCoopCloseOptionalStaging,
980-
) && p.LocalFeatures().HasFeature(
981-
lnwire.RbfCoopCloseOptionalStaging,
982-
)
978+
bothHaveBit := func(bit lnwire.FeatureBit) bool {
979+
return p.RemoteFeatures().HasFeature(bit) &&
980+
p.LocalFeatures().HasFeature(bit)
981+
}
982+
983+
return bothHaveBit(lnwire.RbfCoopCloseOptional) ||
984+
bothHaveBit(lnwire.RbfCoopCloseOptionalStaging)
983985
}
984986

985987
// QuitSignal is a method that should return a channel which will be sent upon

0 commit comments

Comments
 (0)