• 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
/lnwire/announcement_signatures_2.go
1
package lnwire
2

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

8
// AnnounceSignatures2 is a direct message between two endpoints of a
9
// channel and serves as an opt-in mechanism to allow the announcement of
10
// a taproot channel to the rest of the network. It contains the necessary
11
// signatures by the sender to construct the channel_announcement_2 message.
12
type AnnounceSignatures2 struct {
13
        // ChannelID is the unique description of the funding transaction.
14
        // Channel id is better for users and debugging and short channel id is
15
        // used for quick test on existence of the particular utxo inside the
16
        // blockchain, because it contains information about block.
17
        ChannelID ChannelID
18

19
        // ShortChannelID is the unique description of the funding transaction.
20
        // It is constructed with the most significant 3 bytes as the block
21
        // height, the next 3 bytes indicating the transaction index within the
22
        // block, and the least significant two bytes indicating the output
23
        // index which pays to the channel.
24
        ShortChannelID ShortChannelID
25

26
        // PartialSignature is the combination of the partial Schnorr signature
27
        // created for the node's bitcoin key with the partial signature created
28
        // for the node's node ID key.
29
        PartialSignature PartialSig
30

31
        // ExtraOpaqueData is the set of data that was appended to this
32
        // message, some of which we may not actually know how to iterate or
33
        // parse. By holding onto this data, we ensure that we're able to
34
        // properly validate the set of signatures that cover these new fields,
35
        // and ensure we're able to make upgrades to the network in a forwards
36
        // compatible manner.
37
        ExtraOpaqueData ExtraOpaqueData
38
}
39

40
// A compile time check to ensure AnnounceSignatures2 implements the
41
// lnwire.Message interface.
42
var _ Message = (*AnnounceSignatures2)(nil)
43

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

48
// Decode deserializes a serialized AnnounceSignatures2 stored in the passed
49
// io.Reader observing the specified protocol version.
50
//
51
// This is part of the lnwire.Message interface.
UNCOV
52
func (a *AnnounceSignatures2) Decode(r io.Reader, _ uint32) error {
×
UNCOV
53
        return ReadElements(r,
×
UNCOV
54
                &a.ChannelID,
×
UNCOV
55
                &a.ShortChannelID,
×
UNCOV
56
                &a.PartialSignature,
×
UNCOV
57
                &a.ExtraOpaqueData,
×
UNCOV
58
        )
×
UNCOV
59
}
×
60

61
// Encode serializes the target AnnounceSignatures2 into the passed io.Writer
62
// observing the protocol version specified.
63
//
64
// This is part of the lnwire.Message interface.
UNCOV
65
func (a *AnnounceSignatures2) Encode(w *bytes.Buffer, _ uint32) error {
×
UNCOV
66
        if err := WriteChannelID(w, a.ChannelID); err != nil {
×
67
                return err
×
68
        }
×
69

UNCOV
70
        if err := WriteShortChannelID(w, a.ShortChannelID); err != nil {
×
71
                return err
×
72
        }
×
73

UNCOV
74
        if err := WriteElement(w, a.PartialSignature); err != nil {
×
75
                return err
×
76
        }
×
77

UNCOV
78
        return WriteBytes(w, a.ExtraOpaqueData)
×
79
}
80

81
// MsgType returns the integer uniquely identifying this message type on the
82
// wire.
83
//
84
// This is part of the lnwire.Message interface.
UNCOV
85
func (a *AnnounceSignatures2) MsgType() MessageType {
×
UNCOV
86
        return MsgAnnounceSignatures2
×
UNCOV
87
}
×
88

89
// SerializedSize returns the serialized size of the message in bytes.
90
//
91
// This is part of the lnwire.SizeableMessage interface.
92
func (a *AnnounceSignatures2) SerializedSize() (uint32, error) {
×
93
        return MessageSerializedSize(a)
×
94
}
×
95

96
// SCID returns the ShortChannelID of the channel.
97
//
98
// NOTE: this is part of the AnnounceSignatures interface.
99
func (a *AnnounceSignatures2) SCID() ShortChannelID {
×
100
        return a.ShortChannelID
×
101
}
×
102

103
// ChanID returns the ChannelID identifying the channel.
104
//
105
// NOTE: this is part of the AnnounceSignatures interface.
106
func (a *AnnounceSignatures2) ChanID() ChannelID {
×
107
        return a.ChannelID
×
108
}
×
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