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

lightningnetwork / lnd / 13440912774

20 Feb 2025 05:14PM UTC coverage: 57.697% (-1.1%) from 58.802%
13440912774

Pull #9535

github

guggero
GitHub: remove duplicate caching

Turns out that actions/setup-go starting with @v4 also adds caching.
With that, our cache size on disk has almost doubled, leading to the
GitHub runner running out of space in certain situation.
We fix that by disabling the automated caching since we already have our
own, custom-tailored version.
Pull Request #9535: GitHub: remove duplicate caching

103519 of 179417 relevant lines covered (57.7%)

24825.3 hits per line

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

64.0
/lnwire/update_fail_htlc.go
1
package lnwire
2

3
import (
4
        "bytes"
5
        "io"
6
)
7

8
// OpaqueReason is an opaque encrypted byte slice that encodes the exact
9
// failure reason and additional some supplemental data. The contents of this
10
// slice can only be decrypted by the sender of the original HTLC.
11
type OpaqueReason []byte
12

13
// UpdateFailHTLC is sent by Alice to Bob in order to remove a previously added
14
// HTLC. Upon receipt of an UpdateFailHTLC the HTLC should be removed from the
15
// next commitment transaction, with the UpdateFailHTLC propagated backwards in
16
// the route to fully undo the HTLC.
17
type UpdateFailHTLC struct {
18
        // ChanID is the particular active channel that this
19
        // UpdateFailHTLC is bound to.
20
        ChanID ChannelID
21

22
        // ID references which HTLC on the remote node's commitment transaction
23
        // has timed out.
24
        ID uint64
25

26
        // Reason is an onion-encrypted blob that details why the HTLC was
27
        // failed. This blob is only fully decryptable by the initiator of the
28
        // HTLC message.
29
        Reason OpaqueReason
30

31
        // ExtraData is the set of data that was appended to this message to
32
        // fill out the full maximum transport message size. These fields can
33
        // be used to specify optional data such as custom TLV fields.
34
        ExtraData ExtraOpaqueData
35
}
36

37
// A compile time check to ensure UpdateFailHTLC implements the lnwire.Message
38
// interface.
39
var _ Message = (*UpdateFailHTLC)(nil)
40

41
// Decode deserializes a serialized UpdateFailHTLC message stored in the passed
42
// io.Reader observing the specified protocol version.
43
//
44
// This is part of the lnwire.Message interface.
45
func (c *UpdateFailHTLC) Decode(r io.Reader, pver uint32) error {
570✔
46
        return ReadElements(r,
570✔
47
                &c.ChanID,
570✔
48
                &c.ID,
570✔
49
                &c.Reason,
570✔
50
                &c.ExtraData,
570✔
51
        )
570✔
52
}
570✔
53

54
// Encode serializes the target UpdateFailHTLC into the passed io.Writer observing
55
// the protocol version specified.
56
//
57
// This is part of the lnwire.Message interface.
58
func (c *UpdateFailHTLC) Encode(w *bytes.Buffer, pver uint32) error {
792✔
59
        if err := WriteChannelID(w, c.ChanID); err != nil {
792✔
60
                return err
×
61
        }
×
62

63
        if err := WriteUint64(w, c.ID); err != nil {
792✔
64
                return err
×
65
        }
×
66

67
        if err := WriteOpaqueReason(w, c.Reason); err != nil {
792✔
68
                return err
×
69
        }
×
70

71
        return WriteBytes(w, c.ExtraData)
792✔
72
}
73

74
// MsgType returns the integer uniquely identifying this message type on the
75
// wire.
76
//
77
// This is part of the lnwire.Message interface.
78
func (c *UpdateFailHTLC) MsgType() MessageType {
930✔
79
        return MsgUpdateFailHTLC
930✔
80
}
930✔
81

82
// TargetChanID returns the channel id of the link for which this message is
83
// intended.
84
//
85
// NOTE: Part of peer.LinkUpdater interface.
86
func (c *UpdateFailHTLC) TargetChanID() ChannelID {
×
87
        return c.ChanID
×
88
}
×
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