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

lightningnetwork / lnd / 21485572389

29 Jan 2026 04:09PM UTC coverage: 65.247% (+0.2%) from 65.074%
21485572389

Pull #10089

github

web-flow
Merge 22d34d15e into 19b2ad797
Pull Request #10089: Onion message forwarding

1152 of 1448 new or added lines in 23 files covered. (79.56%)

4109 existing lines in 29 files now uncovered.

139515 of 213825 relevant lines covered (65.25%)

20529.09 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
        // NoOnionMessagesOption disables onion message forwarding.
75
        NoOnionMessagesOption bool `long:"no-onion-messages" description:"disable support for onion messaging"`
76

77
        // NoExperimentalAccountabilityOption disables experimental accountability.
78
        NoExperimentalAccountabilityOption bool `long:"no-experimental-accountability" description:"do not forward experimental accountability signals"`
79

80
        // NoExperimentalEndorsementOption is the deprecated name for
81
        // NoExperimentalAccountabilityOption. It is hidden and will be removed
82
        // in a future release.
83
        NoExperimentalEndorsementOption bool `long:"no-experimental-endorsement" hidden:"true" description:"deprecated: use no-experimental-accountability instead"`
84

85
        // CustomMessage allows the custom message APIs to handle messages with
86
        // the provided protocol numbers, which fall outside the custom message
87
        // number range.
88
        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."`
89

90
        // CustomInit specifies feature bits to advertise in the node's init
91
        // message.
92
        CustomInit []uint16 `long:"custom-init" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's init message"`
93

94
        // CustomNodeAnn specifies custom feature bits to advertise in the
95
        // node's announcement message.
96
        CustomNodeAnn []uint16 `long:"custom-nodeann" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's announcement message"`
97

98
        // CustomInvoice specifies custom feature bits to advertise in the
99
        // node's invoices.
100
        CustomInvoice []uint16 `long:"custom-invoice" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's invoices"`
101
}
102

103
// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
104
// channels.
UNCOV
105
func (l *ProtocolOptions) Wumbo() bool {
×
106
        return l.WumboChans
×
107
}
×
108

109
// NoAnchorCommitments returns true if we have disabled support for the anchor
110
// commitment type.
UNCOV
111
func (l *ProtocolOptions) NoAnchorCommitments() bool {
×
112
        return l.NoAnchors
×
113
}
×
114

115
// NoScriptEnforcementLease returns true if we have disabled support for the
116
// script enforcement commitment type for leased channels.
117
func (l *ProtocolOptions) NoScriptEnforcementLease() bool {
×
118
        return l.NoScriptEnforcedLease
×
119
}
×
120

121
// ScidAlias returns true if we have enabled the option-scid-alias feature bit.
122
func (l *ProtocolOptions) ScidAlias() bool {
×
123
        return l.OptionScidAlias
×
124
}
×
125

126
// ZeroConf returns true if we have enabled the zero-conf feature bit.
UNCOV
127
func (l *ProtocolOptions) ZeroConf() bool {
×
128
        return l.OptionZeroConf
×
129
}
×
130

131
// NoAnySegwit returns true if we don't signal that we understand other newer
132
// segwit witness versions for co-op close addresses.
UNCOV
133
func (l *ProtocolOptions) NoAnySegwit() bool {
×
UNCOV
134
        return l.NoOptionAnySegwit
×
UNCOV
135
}
×
136

137
// NoTimestampsQuery returns true if we should not ask our syncing peers to also
138
// send us the timestamps of announcement messages when we send them a channel
139
// range query, and it also means that we will not respond with timestamps if
140
// requested by our peer.
141
func (l *ProtocolOptions) NoTimestampsQuery() bool {
×
142
        return l.NoTimestampQueryOption
×
143
}
×
144

145
// NoRouteBlinding returns true if forwarding of blinded payments is disabled.
NEW
146
func (l *ProtocolOptions) NoRouteBlinding() bool {
×
NEW
147
        return l.NoRouteBlindingOption
×
NEW
148
}
×
149

150
// NoOnionMessages returns true if onion messaging is disabled.
UNCOV
151
func (l *ProtocolOptions) NoOnionMessages() bool {
×
152
        return l.NoOnionMessagesOption
×
153
}
×
154

155
// NoExpAccountability returns true if experimental accountability should be
156
// disabled. It also checks the deprecated NoExperimentalEndorsementOption for
157
// backwards compatibility.
158
func (l *ProtocolOptions) NoExpAccountability() bool {
×
159
        return l.NoExperimentalAccountabilityOption ||
×
UNCOV
160
                l.NoExperimentalEndorsementOption
×
UNCOV
161
}
×
162

163
// NoQuiescence returns true if quiescence is disabled.
164
func (l *ProtocolOptions) NoQuiescence() bool {
×
165
        return false
×
UNCOV
166
}
×
167

168
// CustomMessageOverrides returns the set of protocol messages that we override
169
// to allow custom handling.
170
func (p ProtocolOptions) CustomMessageOverrides() []uint16 {
×
171
        return p.CustomMessage
×
172
}
×
173

174
// CustomFeatures returns a custom set of feature bits to advertise.
175
func (p ProtocolOptions) CustomFeatures() map[feature.Set][]lnwire.FeatureBit {
×
176
        customFeatures := make(map[feature.Set][]lnwire.FeatureBit)
×
177

×
UNCOV
178
        setFeatures := func(set feature.Set, bits []uint16) {
×
UNCOV
179
                for _, customFeature := range bits {
×
180
                        customFeatures[set] = append(
×
181
                                customFeatures[set],
×
182
                                lnwire.FeatureBit(customFeature),
×
183
                        )
×
184
                }
×
185
        }
186

UNCOV
187
        setFeatures(feature.SetInit, p.CustomInit)
×
UNCOV
188
        setFeatures(feature.SetNodeAnn, p.CustomNodeAnn)
×
UNCOV
189
        setFeatures(feature.SetInvoice, p.CustomInvoice)
×
UNCOV
190

×
UNCOV
191
        return customFeatures
×
192
}
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

© 2026 Coveralls, Inc