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

lightningnetwork / lnd / 14358372723

09 Apr 2025 01:26PM UTC coverage: 56.696% (-12.3%) from 69.037%
14358372723

Pull #9696

github

web-flow
Merge e2837e400 into 867d27d68
Pull Request #9696: Add `development_guidelines.md` for both human and machine

107055 of 188823 relevant lines covered (56.7%)

22721.56 hits per line

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

58.33
/lnwire/reply_short_chan_ids_end.go
1
package lnwire
2

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

7
        "github.com/btcsuite/btcd/chaincfg/chainhash"
8
)
9

10
// ReplyShortChanIDsEnd is a message that marks the end of a streaming message
11
// response to an initial QueryShortChanIDs message. This marks that the
12
// receiver of the original QueryShortChanIDs for the target chain has either
13
// sent all adequate responses it knows of, or doesn't know of any short chan
14
// ID's for the target chain.
15
type ReplyShortChanIDsEnd struct {
16
        // ChainHash denotes the target chain that we're respond to a short
17
        // chan ID query for.
18
        ChainHash chainhash.Hash
19

20
        // Complete will be set to 0 if we don't know of the chain that the
21
        // remote peer sent their query for. Otherwise, we'll set this to 1 in
22
        // order to indicate that we've sent all known responses for the prior
23
        // set of short chan ID's in the corresponding QueryShortChanIDs
24
        // message.
25
        Complete uint8
26

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

33
// NewReplyShortChanIDsEnd creates a new empty ReplyShortChanIDsEnd message.
34
func NewReplyShortChanIDsEnd() *ReplyShortChanIDsEnd {
×
35
        return &ReplyShortChanIDsEnd{}
×
36
}
×
37

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

42
// A compile time check to ensure ReplyShortChanIDsEnd implements the
43
// lnwire.SizeableMessage interface.
44
var _ SizeableMessage = (*ReplyShortChanIDsEnd)(nil)
45

46
// Decode deserializes a serialized ReplyShortChanIDsEnd message stored in the
47
// passed io.Reader observing the specified protocol version.
48
//
49
// This is part of the lnwire.Message interface.
50
func (c *ReplyShortChanIDsEnd) Decode(r io.Reader, pver uint32) error {
130✔
51
        return ReadElements(r,
130✔
52
                c.ChainHash[:],
130✔
53
                &c.Complete,
130✔
54
                &c.ExtraData,
130✔
55
        )
130✔
56
}
130✔
57

58
// Encode serializes the target ReplyShortChanIDsEnd into the passed io.Writer
59
// observing the protocol version specified.
60
//
61
// This is part of the lnwire.Message interface.
62
func (c *ReplyShortChanIDsEnd) Encode(w *bytes.Buffer, pver uint32) error {
114✔
63
        if err := WriteBytes(w, c.ChainHash[:]); err != nil {
114✔
64
                return err
×
65
        }
×
66

67
        if err := WriteUint8(w, c.Complete); err != nil {
114✔
68
                return err
×
69
        }
×
70

71
        return WriteBytes(w, c.ExtraData)
114✔
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 *ReplyShortChanIDsEnd) MsgType() MessageType {
114✔
79
        return MsgReplyShortChanIDsEnd
114✔
80
}
114✔
81

82
// SerializedSize returns the serialized size of the message in bytes.
83
//
84
// This is part of the lnwire.SizeableMessage interface.
85
func (c *ReplyShortChanIDsEnd) SerializedSize() (uint32, error) {
×
86
        return MessageSerializedSize(c)
×
87
}
×
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