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

lightningnetwork / lnd / 15736109134

18 Jun 2025 02:46PM UTC coverage: 58.197% (-10.1%) from 68.248%
15736109134

Pull #9752

github

web-flow
Merge d2634a68c into 31c74f20f
Pull Request #9752: routerrpc: reject payment to invoice that don't have payment secret or blinded paths

6 of 13 new or added lines in 2 files covered. (46.15%)

28331 existing lines in 455 files now uncovered.

97860 of 168153 relevant lines covered (58.2%)

1.81 hits per line

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

0.0
/channeldb/migration/lnwire21/commit_sig.go
1
package lnwire
2

3
import (
4
        "io"
5
)
6

7
// CommitSig is sent by either side to stage any pending HTLC's in the
8
// receiver's pending set into a new commitment state. Implicitly, the new
9
// commitment transaction constructed which has been signed by CommitSig
10
// includes all HTLC's in the remote node's pending set. A CommitSig message
11
// may be sent after a series of UpdateAddHTLC/UpdateFulfillHTLC messages in
12
// order to batch add several HTLC's with a single signature covering all
13
// implicitly accepted HTLC's.
14
type CommitSig struct {
15
        // ChanID uniquely identifies to which currently active channel this
16
        // CommitSig applies to.
17
        ChanID ChannelID
18

19
        // CommitSig is Alice's signature for Bob's new commitment transaction.
20
        // Alice is able to send this signature without requesting any
21
        // additional data due to the piggybacking of Bob's next revocation
22
        // hash in his prior RevokeAndAck message, as well as the canonical
23
        // ordering used for all inputs/outputs within commitment transactions.
24
        // If initiating a new commitment state, this signature should ONLY
25
        // cover all of the sending party's pending log updates, and the log
26
        // updates of the remote party that have been ACK'd.
27
        CommitSig Sig
28

29
        // HtlcSigs is a signature for each relevant HTLC output within the
30
        // created commitment. The order of the signatures is expected to be
31
        // identical to the placement of the HTLC's within the BIP 69 sorted
32
        // commitment transaction. For each outgoing HTLC (from the PoV of the
33
        // sender of this message), a signature for an HTLC timeout transaction
34
        // should be signed, for each incoming HTLC the HTLC timeout
35
        // transaction should be signed.
36
        HtlcSigs []Sig
37
}
38

39
// NewCommitSig creates a new empty CommitSig message.
40
func NewCommitSig() *CommitSig {
×
41
        return &CommitSig{}
×
42
}
×
43

44
// A compile time check to ensure CommitSig implements the lnwire.Message
45
// interface.
46
var _ Message = (*CommitSig)(nil)
47

48
// Decode deserializes a serialized CommitSig message stored in the
49
// passed io.Reader observing the specified protocol version.
50
//
51
// This is part of the lnwire.Message interface.
UNCOV
52
func (c *CommitSig) Decode(r io.Reader, pver uint32) error {
×
UNCOV
53
        return ReadElements(r,
×
UNCOV
54
                &c.ChanID,
×
UNCOV
55
                &c.CommitSig,
×
UNCOV
56
                &c.HtlcSigs,
×
UNCOV
57
        )
×
UNCOV
58
}
×
59

60
// Encode serializes the target CommitSig into the passed io.Writer
61
// observing the protocol version specified.
62
//
63
// This is part of the lnwire.Message interface.
UNCOV
64
func (c *CommitSig) Encode(w io.Writer, pver uint32) error {
×
UNCOV
65
        return WriteElements(w,
×
UNCOV
66
                c.ChanID,
×
UNCOV
67
                c.CommitSig,
×
UNCOV
68
                c.HtlcSigs,
×
UNCOV
69
        )
×
UNCOV
70
}
×
71

72
// MsgType returns the integer uniquely identifying this message type on the
73
// wire.
74
//
75
// This is part of the lnwire.Message interface.
UNCOV
76
func (c *CommitSig) MsgType() MessageType {
×
UNCOV
77
        return MsgCommitSig
×
UNCOV
78
}
×
79

80
// MaxPayloadLength returns the maximum allowed payload size for a
81
// CommitSig complete message observing the specified protocol version.
82
//
83
// This is part of the lnwire.Message interface.
UNCOV
84
func (c *CommitSig) MaxPayloadLength(uint32) uint32 {
×
UNCOV
85
        // 32 + 64 + 2 + max_allowed_htlcs
×
UNCOV
86
        return MaxMessagePayload
×
UNCOV
87
}
×
88

89
// TargetChanID returns the channel id of the link for which this message is
90
// intended.
91
//
92
// NOTE: Part of peer.LinkUpdater interface.
93
func (c *CommitSig) TargetChanID() ChannelID {
×
94
        return c.ChanID
×
95
}
×
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