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

lightningnetwork / lnd / 11216766535

07 Oct 2024 01:37PM UTC coverage: 57.817% (-1.0%) from 58.817%
11216766535

Pull #9148

github

ProofOfKeags
lnwire: remove kickoff feerate from propose/commit
Pull Request #9148: DynComms [2/n]: lnwire: add authenticated wire messages for Dyn*

571 of 879 new or added lines in 16 files covered. (64.96%)

23253 existing lines in 251 files now uncovered.

99022 of 171268 relevant lines covered (57.82%)

38420.67 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:lll
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
        // NoAnchors should be set if we don't want to support opening or accepting
35
        // channels having the anchor commitment type.
36
        NoAnchors bool `long:"no-anchors" description:"disable support for anchor commitments"`
37

38
        // NoScriptEnforcedLease should be set if we don't want to support
39
        // opening or accepting channels having the script enforced commitment
40
        // type for leased channel.
41
        NoScriptEnforcedLease bool `long:"no-script-enforced-lease" description:"disable support for script enforced lease commitments"`
42

43
        // OptionScidAlias should be set if we want to signal the
44
        // option-scid-alias feature bit. This allows scid aliases and the
45
        // option-scid-alias channel-type.
46
        OptionScidAlias bool `long:"option-scid-alias" description:"enable support for option_scid_alias channels"`
47

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

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

56
        // NoTimestampQueryOption should be set to true if we don't want our
57
        // syncing peers to also send us the timestamps of announcement messages
58
        // when we send them a channel range query. Setting this to true will
59
        // also mean that we won't respond with timestamps if requested by our
60
        // peers.
61
        NoTimestampQueryOption bool `long:"no-timestamp-query-option" description:"do not query syncing peers for announcement timestamps and do not respond with timestamps if requested"`
62

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

66
        // CustomMessage allows the custom message APIs to handle messages with
67
        // the provided protocol numbers, which fall outside the custom message
68
        // number range.
69
        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."`
70

71
        // CustomInit specifies feature bits to advertise in the node's init
72
        // message.
73
        CustomInit []uint16 `long:"custom-init" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's init message"`
74

75
        // CustomNodeAnn specifies custom feature bits to advertise in the
76
        // node's announcement message.
77
        CustomNodeAnn []uint16 `long:"custom-nodeann" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's announcement message"`
78

79
        // CustomInvoice specifies custom feature bits to advertise in the
80
        // node's invoices.
81
        CustomInvoice []uint16 `long:"custom-invoice" description:"custom feature bits — numbers defined in BOLT 9 — to advertise in the node's invoices"`
82
}
83

84
// Wumbo returns true if lnd should permit the creation and acceptance of wumbo
85
// channels.
86
func (l *ProtocolOptions) Wumbo() bool {
87
        return l.WumboChans
88
}
89

UNCOV
90
// NoAnchorCommitments returns true if we have disabled support for the anchor
×
UNCOV
91
// commitment type.
×
92
func (l *ProtocolOptions) NoAnchorCommitments() bool {
×
93
        return l.NoAnchors
94
}
95

UNCOV
96
// NoScriptEnforcementLease returns true if we have disabled support for the
×
UNCOV
97
// script enforcement commitment type for leased channels.
×
98
func (l *ProtocolOptions) NoScriptEnforcementLease() bool {
×
99
        return l.NoScriptEnforcedLease
100
}
101

UNCOV
102
// ScidAlias returns true if we have enabled the option-scid-alias feature bit.
×
103
func (l *ProtocolOptions) ScidAlias() bool {
×
104
        return l.OptionScidAlias
×
105
}
106

UNCOV
107
// ZeroConf returns true if we have enabled the zero-conf feature bit.
×
108
func (l *ProtocolOptions) ZeroConf() bool {
×
109
        return l.OptionZeroConf
×
110
}
111

UNCOV
112
// NoAnySegwit returns true if we don't signal that we understand other newer
×
UNCOV
113
// segwit witness versions for co-op close addresses.
×
114
func (l *ProtocolOptions) NoAnySegwit() bool {
×
115
        return l.NoOptionAnySegwit
116
}
117

UNCOV
118
// NoTimestampsQuery returns true if we should not ask our syncing peers to also
×
UNCOV
119
// send us the timestamps of announcement messages when we send them a channel
×
UNCOV
120
// range query, and it also means that we will not respond with timestamps if
×
121
// requested by our peer.
122
func (l *ProtocolOptions) NoTimestampsQuery() bool {
123
        return l.NoTimestampQueryOption
124
}
125

UNCOV
126
// NoRouteBlinding returns true if forwarding of blinded payments is disabled.
×
127
func (l *ProtocolOptions) NoRouteBlinding() bool {
×
128
        return l.NoRouteBlindingOption
×
129
}
130

UNCOV
131
// CustomMessageOverrides returns the set of protocol messages that we override
×
UNCOV
132
// to allow custom handling.
×
133
func (p ProtocolOptions) CustomMessageOverrides() []uint16 {
×
134
        return p.CustomMessage
135
}
136

UNCOV
137
// CustomFeatures returns a custom set of feature bits to advertise.
×
138
func (p ProtocolOptions) CustomFeatures() map[feature.Set][]lnwire.FeatureBit {
×
139
        customFeatures := make(map[feature.Set][]lnwire.FeatureBit)
×
140

141
        setFeatures := func(set feature.Set, bits []uint16) {
142
                for _, customFeature := range bits {
×
143
                        customFeatures[set] = append(
×
144
                                customFeatures[set],
×
145
                                lnwire.FeatureBit(customFeature),
×
146
                        )
×
147
                }
×
UNCOV
148
        }
×
UNCOV
149

×
150
        setFeatures(feature.SetInit, p.CustomInit)
×
151
        setFeatures(feature.SetNodeAnn, p.CustomNodeAnn)
×
152
        setFeatures(feature.SetInvoice, p.CustomInvoice)
153

154
        return customFeatures
×
UNCOV
155
}
×
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