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

lightningnetwork / lnd / 15561477203

10 Jun 2025 01:54PM UTC coverage: 58.351% (-10.1%) from 68.487%
15561477203

Pull #9356

github

web-flow
Merge 6440b25db into c6d6d4c0b
Pull Request #9356: lnrpc: add incoming/outgoing channel ids filter to forwarding history request

33 of 36 new or added lines in 2 files covered. (91.67%)

28366 existing lines in 455 files now uncovered.

97715 of 167461 relevant lines covered (58.35%)

1.81 hits per line

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

0.0
/lnwire/dyn_reject.go
1
package lnwire
2

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

8
// DynReject is a message that is sent during a dynamic commitments negotiation
9
// process. It is sent by both parties to propose new channel parameters.
10
type DynReject struct {
11
        // ChanID identifies the channel whose parameters we are trying to
12
        // re-negotiate.
13
        ChanID ChannelID
14

15
        // UpdateRejections is a bit vector that specifies which of the
16
        // DynPropose parameters we wish to call out as being unacceptable.
17
        UpdateRejections RawFeatureVector
18

19
        // ExtraData is the set of data that was appended to this message to
20
        // fill out the full maximum transport message size. These fields can
21
        // be used to specify optional data such as custom TLV fields.
22
        //
23
        // NOTE: Since the fields in this structure are part of the TLV stream,
24
        // ExtraData will contain all TLV records _except_ the ones that are
25
        // present in earlier parts of this structure.
26
        ExtraData ExtraOpaqueData
27
}
28

29
// A compile time check to ensure DynReject implements the lnwire.Message
30
// interface.
31
var _ Message = (*DynReject)(nil)
32

33
// A compile time check to ensure DynReject implements the
34
// lnwire.SizeableMessage interface.
35
var _ SizeableMessage = (*DynReject)(nil)
36

37
// Encode serializes the target DynReject into the passed io.Writer.
38
// Serialization will observe the rules defined by the passed protocol version.
39
//
40
// This is a part of the lnwire.Message interface.
UNCOV
41
func (dr *DynReject) Encode(w *bytes.Buffer, _ uint32) error {
×
UNCOV
42
        if err := WriteChannelID(w, dr.ChanID); err != nil {
×
43
                return err
×
44
        }
×
45

UNCOV
46
        if err := WriteRawFeatureVector(w, &dr.UpdateRejections); err != nil {
×
47
                return err
×
48
        }
×
49

UNCOV
50
        return WriteBytes(w, dr.ExtraData)
×
51
}
52

53
// Decode deserializes the serialized DynReject stored in the passed io.Reader
54
// into the target DynReject using the deserialization rules defined by the
55
// passed protocol version.
56
//
57
// This is a part of the lnwire.Message interface.
UNCOV
58
func (dr *DynReject) Decode(r io.Reader, _ uint32) error {
×
UNCOV
59
        var extra ExtraOpaqueData
×
UNCOV
60

×
UNCOV
61
        if err := ReadElements(
×
UNCOV
62
                r, &dr.ChanID, &dr.UpdateRejections, &extra,
×
UNCOV
63
        ); err != nil {
×
UNCOV
64
                return err
×
UNCOV
65
        }
×
66

UNCOV
67
        if len(extra) != 0 {
×
UNCOV
68
                dr.ExtraData = extra
×
UNCOV
69
        }
×
70

UNCOV
71
        return nil
×
72
}
73

74
// MsgType returns the MessageType code which uniquely identifies this message
75
// as a DynReject on the wire.
76
//
77
// This is part of the lnwire.Message interface.
UNCOV
78
func (dr *DynReject) MsgType() MessageType {
×
UNCOV
79
        return MsgDynReject
×
UNCOV
80
}
×
81

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