Skip to content

Commit ac76d63

Browse files
authored
Merge pull request #9858 from Roasbeef/non-staging-rbf-coop
peer+feature: start to signal the prod rbf coop close bit
2 parents 7e44422 + 03b35d0 commit ac76d63

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)