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

lightningnetwork / lnd / 12343072627

15 Dec 2024 11:09PM UTC coverage: 57.504% (-1.1%) from 58.636%
12343072627

Pull #9315

github

yyforyongyu
contractcourt: offer outgoing htlc one block earlier before its expiry

We need to offer the outgoing htlc one block earlier to make sure when
the expiry height hits, the sweeper will not miss sweeping it in the
same block. This also means the outgoing contest resolver now only does
one thing - watch for preimage spend till height expiry-1, which can
easily be moved into the timeout resolver instead in the future.
Pull Request #9315: Implement `blockbeat`

1445 of 2007 new or added lines in 26 files covered. (72.0%)

19246 existing lines in 249 files now uncovered.

102342 of 177975 relevant lines covered (57.5%)

24772.24 hits per line

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

0.0
/htlcswitch/hodl/config_dev.go
1
//go:build dev
2
// +build dev
3

4
package hodl
5

6
// Config is a struct enumerating the possible command line flags that are used
7
// to activate specific hodl modes.
8
//
9
// NOTE: THESE FLAGS ARE INTENDED FOR TESTING PURPOSES ONLY. ACTIVATING THESE
10
// FLAGS IN PRODUCTION WILL VIOLATE CRITICAL ASSUMPTIONS MADE BY THIS SOFTWARE.
11
type Config struct {
12
        ExitSettle bool `long:"exit-settle" description:"Instructs the node to drop ADDs for which it is the exit node, and to not settle back to the sender"`
13

14
        AddIncoming bool `long:"add-incoming" description:"Instructs the node to drop incoming ADDs before processing them in the incoming link"`
15

16
        SettleIncoming bool `long:"settle-incoming" description:"Instructs the node to drop incoming SETTLEs before processing them in the incoming link"`
17

18
        FailIncoming bool `long:"fail-incoming" description:"Instructs the node to drop incoming FAILs before processing them in the incoming link"`
19

20
        AddOutgoing bool `long:"add-outgoing" description:"Instructs the node to drop outgoing ADDs before applying them to the channel state"`
21

22
        SettleOutgoing bool `long:"settle-outgoing" description:"Instructs the node to drop outgoing SETTLEs before applying them to the channel state"`
23

24
        FailOutgoing bool `long:"fail-outgoing" description:"Instructs the node to drop outgoing FAILs before applying them to the channel state"`
25

26
        Commit bool `long:"commit" description:"Instructs the node to add HTLCs to its local commitment state and to open circuits for any ADDs, but abort before committing the changes"`
27

28
        BogusSettle bool `long:"bogus-settle" description:"Instructs the node to settle back any incoming HTLC with a bogus preimage"`
29
}
30

31
// Mask extracts the flags specified in the configuration, composing a Mask from
32
// the active flags.
UNCOV
33
func (c *Config) Mask() Mask {
×
UNCOV
34
        var flags []Flag
×
UNCOV
35

×
UNCOV
36
        if c.ExitSettle {
×
UNCOV
37
                flags = append(flags, ExitSettle)
×
UNCOV
38
        }
×
UNCOV
39
        if c.AddIncoming {
×
40
                flags = append(flags, AddIncoming)
×
41
        }
×
UNCOV
42
        if c.SettleIncoming {
×
43
                flags = append(flags, SettleIncoming)
×
44
        }
×
UNCOV
45
        if c.FailIncoming {
×
46
                flags = append(flags, FailIncoming)
×
47
        }
×
UNCOV
48
        if c.AddOutgoing {
×
49
                flags = append(flags, AddOutgoing)
×
50
        }
×
UNCOV
51
        if c.SettleOutgoing {
×
52
                flags = append(flags, SettleOutgoing)
×
53
        }
×
UNCOV
54
        if c.FailOutgoing {
×
55
                flags = append(flags, FailOutgoing)
×
56
        }
×
UNCOV
57
        if c.Commit {
×
UNCOV
58
                flags = append(flags, Commit)
×
UNCOV
59
        }
×
UNCOV
60
        if c.BogusSettle {
×
UNCOV
61
                flags = append(flags, BogusSettle)
×
UNCOV
62
        }
×
63

64
        // NOTE: The value returned here will only honor the configuration if
65
        // the dev build flag is present. In production, this method always
66
        // returns hodl.MaskNone and Active(*) always returns false.
UNCOV
67
        return MaskFromFlags(flags...)
×
68
}
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