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

lightningnetwork / lnd / 13236757158

10 Feb 2025 08:39AM UTC coverage: 57.649% (-1.2%) from 58.815%
13236757158

Pull #9493

github

ziggie1984
lncli: for some cmds we don't replace the data of the response.

For some cmds it is not very practical to replace the json output
because we might pipe it into other commands. For example when
creating the route we want to pipe it into sendtoRoute.
Pull Request #9493: For some lncli cmds we should not replace the content with other data

0 of 9 new or added lines in 2 files covered. (0.0%)

19535 existing lines in 252 files now uncovered.

103517 of 179563 relevant lines covered (57.65%)

24878.49 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.
UNCOV
86
func (c *UpdateFailHTLC) TargetChanID() ChannelID {
×
UNCOV
87
        return c.ChanID
×
UNCOV
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