feature: add new NoRbfCoopClose option

This commit is contained in:
Olaoluwa Osuntokun 2024-03-05 00:18:17 -06:00
parent 6364e98f0e
commit a9e538e52d

View File

@ -73,6 +73,10 @@ type Config struct {
// forwarding experimental endorsement. // forwarding experimental endorsement.
NoExperimentalEndorsement bool NoExperimentalEndorsement bool
// NoRbfCoopClose unsets any bits that signal support for using RBF for
// coop close.
NoRbfCoopClose bool
// CustomFeatures is a set of custom features to advertise in each // CustomFeatures is a set of custom features to advertise in each
// set. // set.
CustomFeatures map[Set][]lnwire.FeatureBit CustomFeatures map[Set][]lnwire.FeatureBit
@ -209,11 +213,13 @@ func newManager(cfg Config, desc setDesc) (*Manager, error) {
raw.Unset(lnwire.SimpleTaprootOverlayChansOptional) raw.Unset(lnwire.SimpleTaprootOverlayChansOptional)
raw.Unset(lnwire.SimpleTaprootOverlayChansRequired) raw.Unset(lnwire.SimpleTaprootOverlayChansRequired)
} }
if cfg.NoExperimentalEndorsement { if cfg.NoExperimentalEndorsement {
raw.Unset(lnwire.ExperimentalEndorsementOptional) raw.Unset(lnwire.ExperimentalEndorsementOptional)
raw.Unset(lnwire.ExperimentalEndorsementRequired) raw.Unset(lnwire.ExperimentalEndorsementRequired)
} }
if cfg.NoRbfCoopClose {
raw.Unset(lnwire.RbfCoopCloseOptionalStaging)
}
for _, custom := range cfg.CustomFeatures[set] { for _, custom := range cfg.CustomFeatures[set] {
if custom > set.Maximum() { if custom > set.Maximum() {