• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lightningnetwork / lnd / 15998672663

01 Jul 2025 12:00PM UTC coverage: 67.569% (+0.001%) from 67.568%
15998672663

Pull #10001

github

web-flow
Merge 4240edd37 into cd7fa6382
Pull Request #10001: Enable quiescence in production and add timeout config

4 of 8 new or added lines in 4 files covered. (50.0%)

69 existing lines in 18 files now uncovered.

135122 of 199975 relevant lines covered (67.57%)

21835.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/lncfg/protocol.go
1
//go:build !integration
2

3
package lncfg
4

5
import (
6
        "github.com/lightningnetwork/lnd/feature"
7
        "github.com/lightningnetwork/lnd/lnwire"
8
)
9

10
// ProtocolOptions is a struct that we use to be able to test backwards
11
// compatibility of protocol additions, while defaulting to the latest within
12
// lnd, or to enable experimental protocol changes.
13
//
14
//nolint:ll
15
type ProtocolOptions struct {
16
        // LegacyProtocol is a sub-config that houses all the legacy protocol
17
        // options.  These are mostly used for integration tests as most modern
18
        // nodes should always run with them on by default.
19
        LegacyProtocol `group:"legacy" namespace:"legacy"`
20

21
        // ExperimentalProtocol is a sub-config that houses any experimental
22
        // protocol features that also require a build-tag to activate.
23
        ExperimentalProtocol
24

25
        // WumboChans should be set if we want to enable support for wumbo
26
        // (channels larger than 0.16 BTC) channels, which is the opposite of
27
        // mini.
28
        WumboChans bool `long:"wumbo-channels" description:"if set, then lnd will create and accept requests for channels larger chan 0.16 BTC"`
29

30
        // TaprootChans should be set if we want to enable support for the
31
        // experimental simple taproot chans commitment type.
32
        TaprootChans bool `long:"simple-taproot-chans" description:"if set, then lnd will create and accept requests for channels using the simple taproot commitment type"`
33

34
        // TaprootOverlayChans should be set if we want to enable support for
35
        // the experimental taproot overlay chan type.
36
        TaprootOverlayChans bool `long:"simple-taproot-overlay-chans" description:"if set, then lnd will create and accept requests for channels using the taproot overlay commitment type"`
37

38
        // RbfCoopClose should be set if we want to signal that we support for
39
        // the new experimental RBF coop close feature.
40
        RbfCoopClose bool `long:"rbf-coop-close" description:"if set, then lnd will signal that it supports the new RBF based coop close protocol, taproot channels are not supported"`
41

42
        // NoAnchors should be set if we don't want to support opening or accepting
43
        // channels having the anchor commitment type.
44
        NoAnchors bool `long:"no-anchors" description:"disable support for anchor commitments"`
45

46
        // NoScriptEnforcedLease should be set if we don't want to support
47
        // opening or accepting channels having the script enforced commitment
48
        // type for leased channel.
49
        NoScriptEnforcedLease bool `long:"no-script-enforced-lease" description:"disable support for script enforced lease commitments"`
50

51
        // OptionScidAlias should be set if we want to signal the
52
        // option-scid-alias feature bit. This allows scid aliases and the
53
        // option-scid-alias channel-type.
54
        OptionScidAlias bool `long:"option-scid-alias" description:"enable support for option_scid_alias channels"`
55

56
        // OptionZeroConf should be set if we want to signal the zero-conf
57
        // feature bit.
58
        OptionZeroConf bool `long:"zero-conf" description:"enable support for zero-conf channels, must have option-scid-alias set also"`
59

60
        // NoOptionAnySegwit should be set to true if we don't want to use any
61
        // Taproot (and beyond) addresses for co-op closing.
62
        NoOptionAnySegwit bool `long:"no-any-segwit" description:"disallow using any segwit witness version as a co-op close address"`
63

64
        // NoTimestampQueryOption should be set to true if we don't want our
65
        // syncing peers to also send us the timestamps of announcement messages
66
        // when we send them a channel range query. Setting this to true will
67
        // also mean that we won't respond with timestamps if requested by our
68
        // peers.
69
        NoTimestampQueryOption bool `long:"no-timestamp-query-option" description:"do not query syncing peers for announcement timestamps and do not respond with timestamps if requested"`
70

71
        // NoRouteBlindingOption disables forwarding of payments in blinded routes.
72
        NoRouteBlindingOption bool `long:"no-route-blinding" description:"do not forward payments that are a part of a blinded route"`
73

74
        // NoExperimentalEndorsementOption disables experimental endorsement.
75
        NoExperimentalEndorsementOption bool `long:"no-experimental-endorsement" description:"do not forward experimental endorsement signals"`
76

77
        // CustomMessage allows the custom message APIs to handle messages with
78
        // the provided protocol numbers, which fall outside the custom message
79
        // number range.
80
        CustomMessage []uint16 `long:"custom-message" description:"allows the custom message apis to send and report messages with the protocol number provided that fall outside of the custom message number range."`
81

82
        // CustomInit specifies feature bits to advertise in the node's init
83
        // message.
84
        CustomInit []uint16 `long:"custom-init" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's init message"`
85

86
        // CustomNodeAnn specifies custom feature bits to advertise in the
87
        // node's announcement message.
88
        CustomNodeAnn []uint16 `long:"custom-nodeann" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's announcement message"`
89

90
        // CustomInvoice specifies custom feature bits to advertise in the
91
        // node's invoices.
92
        CustomInvoice []uint16 `long:"custom-invoice" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's invoices"`
93
}
94

95
// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
96
// channels.
97
func (l *ProtocolOptions) Wumbo() bool {
×
98
        return l.WumboChans
×
99
}
×
100

101
// NoAnchorCommitments returns true if we have disabled support for the anchor
102
// commitment type.
103
func (l *ProtocolOptions) NoAnchorCommitments() bool {
×
104
        return l.NoAnchors
×
105
}
×
106

107
// NoScriptEnforcementLease returns true if we have disabled support for the
108
// script enforcement commitment type for leased channels.
109
func (l *ProtocolOptions) NoScriptEnforcementLease() bool {
×
110
        return l.NoScriptEnforcedLease
×
111
}
×
112

113
// ScidAlias returns true if we have enabled the option-scid-alias feature bit.
114
func (l *ProtocolOptions) ScidAlias() bool {
×
115
        return l.OptionScidAlias
×
116
}
×
117

118
// ZeroConf returns true if we have enabled the zero-conf feature bit.
119
func (l *ProtocolOptions) ZeroConf() bool {
×
120
        return l.OptionZeroConf
×
121
}
×
122

123
// NoAnySegwit returns true if we don't signal that we understand other newer
124
// segwit witness versions for co-op close addresses.
125
func (l *ProtocolOptions) NoAnySegwit() bool {
×
126
        return l.NoOptionAnySegwit
×
127
}
×
128

129
// NoTimestampsQuery returns true if we should not ask our syncing peers to also
130
// send us the timestamps of announcement messages when we send them a channel
131
// range query, and it also means that we will not respond with timestamps if
132
// requested by our peer.
133
func (l *ProtocolOptions) NoTimestampsQuery() bool {
×
134
        return l.NoTimestampQueryOption
×
135
}
×
136

137
// NoRouteBlinding returns true if forwarding of blinded payments is disabled.
138
func (l *ProtocolOptions) NoRouteBlinding() bool {
×
139
        return l.NoRouteBlindingOption
×
140
}
×
141

142
// NoExperimentalEndorsement returns true if experimental endorsement should
143
// be disabled.
144
func (l *ProtocolOptions) NoExperimentalEndorsement() bool {
×
145
        return l.NoExperimentalEndorsementOption
×
146
}
×
147

148
// NoQuiescence returns true if quiescence is disabled.
149
func (l *ProtocolOptions) NoQuiescence() bool {
×
NEW
150
        return false
×
151
}
×
152

153
// CustomMessageOverrides returns the set of protocol messages that we override
154
// to allow custom handling.
155
func (p ProtocolOptions) CustomMessageOverrides() []uint16 {
×
156
        return p.CustomMessage
×
157
}
×
158

159
// CustomFeatures returns a custom set of feature bits to advertise.
160
func (p ProtocolOptions) CustomFeatures() map[feature.Set][]lnwire.FeatureBit {
×
161
        customFeatures := make(map[feature.Set][]lnwire.FeatureBit)
×
162

×
163
        setFeatures := func(set feature.Set, bits []uint16) {
×
164
                for _, customFeature := range bits {
×
165
                        customFeatures[set] = append(
×
166
                                customFeatures[set],
×
167
                                lnwire.FeatureBit(customFeature),
×
168
                        )
×
169
                }
×
170
        }
171

172
        setFeatures(feature.SetInit, p.CustomInit)
×
173
        setFeatures(feature.SetNodeAnn, p.CustomNodeAnn)
×
174
        setFeatures(feature.SetInvoice, p.CustomInvoice)
×
175

×
176
        return customFeatures
×
177
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc