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

lightningnetwork / lnd / 16683051882

01 Aug 2025 07:03PM UTC coverage: 54.949% (-12.1%) from 67.047%
16683051882

Pull #9455

github

web-flow
Merge 3f1f50be8 into 37523b6cb
Pull Request #9455: discovery+lnwire: add support for DNS host name in NodeAnnouncement msg

144 of 226 new or added lines in 7 files covered. (63.72%)

23852 existing lines in 290 files now uncovered.

108751 of 197912 relevant lines covered (54.95%)

22080.83 hits per line

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

0.0
/lncfg/chain.go
1
package lncfg
2

3
import (
4
        "fmt"
5

6
        "github.com/lightningnetwork/lnd/lnwire"
7
)
8

9
// Chain holds the configuration options for the daemon's chain settings.
10
//
11
//nolint:ll
12
type Chain struct {
13
        Active   bool   `long:"active" description:"DEPRECATED: If the chain should be active or not. This field is now ignored since only the Bitcoin chain is supported" hidden:"true"`
14
        ChainDir string `long:"chaindir" description:"The directory to store the chain's data within."`
15

16
        Node string `long:"node" description:"The blockchain interface to use." choice:"btcd" choice:"bitcoind" choice:"neutrino" choice:"nochainbackend"`
17

18
        MainNet         bool     `long:"mainnet" description:"Use the main network"`
19
        TestNet3        bool     `long:"testnet" description:"Use the test network"`
20
        TestNet4        bool     `long:"testnet4" description:"Use the testnet4 test network"`
21
        SimNet          bool     `long:"simnet" description:"Use the simulation test network"`
22
        RegTest         bool     `long:"regtest" description:"Use the regression test network"`
23
        SigNet          bool     `long:"signet" description:"Use the signet test network"`
24
        SigNetChallenge string   `long:"signetchallenge" description:"Connect to a custom signet network defined by this challenge instead of using the global default signet test network -- Can be specified multiple times"`
25
        SigNetSeedNode  []string `long:"signetseednode" description:"Specify a seed node for the signet network instead of using the global default signet network seed nodes"`
26

27
        DefaultNumChanConfs int                 `long:"defaultchanconfs" description:"The default number of confirmations a channel must have before it's considered open. If this is not set, we will scale the value according to the channel size."`
28
        DefaultRemoteDelay  int                 `long:"defaultremotedelay" description:"The default number of blocks we will require our channel counterparty to wait before accessing its funds in case of unilateral close. If this is not set, we will scale the value according to the channel size."`
29
        MaxLocalDelay       uint16              `long:"maxlocaldelay" description:"The maximum blocks we will allow our funds to be timelocked before accessing its funds in case of unilateral close. If a peer proposes a value greater than this, we will reject the channel."`
30
        MinHTLCIn           lnwire.MilliSatoshi `long:"minhtlc" description:"The smallest HTLC we are willing to accept on our channels, in millisatoshi"`
31
        MinHTLCOut          lnwire.MilliSatoshi `long:"minhtlcout" description:"The smallest HTLC we are willing to send out on our channels, in millisatoshi"`
32
        BaseFee             lnwire.MilliSatoshi `long:"basefee" description:"The base fee in millisatoshi we will charge for forwarding payments on our channels"`
33
        FeeRate             lnwire.MilliSatoshi `long:"feerate" description:"The fee rate used when forwarding payments on our channels. The total fee charged is basefee + (amount * feerate / 1000000), where amount is the forwarded amount."`
34
        TimeLockDelta       uint32              `long:"timelockdelta" description:"The CLTV delta we will subtract from a forwarded HTLC's timelock value"`
35
        DNSSeeds            []string            `long:"dnsseed" description:"The seed DNS server(s) to use for initial peer discovery. Must be specified as a '<primary_dns>[,<soa_primary_dns>]' tuple where the SOA address is needed for DNS resolution through Tor but is optional for clearnet users. Multiple tuples can be specified, will overwrite the default seed servers."`
36
}
37

38
// Validate performs validation on our chain config.
UNCOV
39
func (c *Chain) Validate(minTimeLockDelta uint32, minDelay uint16) error {
×
UNCOV
40
        if c.TimeLockDelta < minTimeLockDelta {
×
41
                return fmt.Errorf("timelockdelta must be at least %v",
×
42
                        minTimeLockDelta)
×
43
        }
×
44

45
        // Check that our max local delay isn't set below some reasonable
46
        // minimum value. We do this to prevent setting an unreasonably low
47
        // delay, which would mean that the node would accept no channels.
UNCOV
48
        if c.MaxLocalDelay < minDelay {
×
49
                return fmt.Errorf("MaxLocalDelay must be at least: %v",
×
50
                        minDelay)
×
51
        }
×
52

UNCOV
53
        return nil
×
54
}
55

56
// IsLocalNetwork returns true if the chain is a local network, such as
57
// simnet or regtest.
UNCOV
58
func (c *Chain) IsLocalNetwork() bool {
×
UNCOV
59
        return c.SimNet || c.RegTest
×
UNCOV
60
}
×
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