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

lightningnetwork / lnd / 14194007198

01 Apr 2025 11:05AM UTC coverage: 58.642% (-10.4%) from 69.039%
14194007198

Pull #9666

github

web-flow
Merge 0c8b0351d into b01f4e514
Pull Request #9666: lnd: remove unnecessary debug log to avoid misunderstanding

97158 of 165680 relevant lines covered (58.64%)

1.82 hits per line

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

0.0
/lnwire/update_fee.go
1
package lnwire
2

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

8
// UpdateFee is the message the channel initiator sends to the other peer if
9
// the channel commitment fee needs to be updated.
10
type UpdateFee struct {
11
        // ChanID is the channel that this UpdateFee is meant for.
12
        ChanID ChannelID
13

14
        // FeePerKw is the fee-per-kw on commit transactions that the sender of
15
        // this message wants to use for this channel.
16
        //
17
        // TODO(halseth): make SatPerKWeight when fee estimation is moved to
18
        // own package. Currently this will cause an import cycle.
19
        FeePerKw uint32
20

21
        // ExtraData is the set of data that was appended to this message to
22
        // fill out the full maximum transport message size. These fields can
23
        // be used to specify optional data such as custom TLV fields.
24
        ExtraData ExtraOpaqueData
25
}
26

27
// NewUpdateFee creates a new UpdateFee message.
28
func NewUpdateFee(chanID ChannelID, feePerKw uint32) *UpdateFee {
×
29
        return &UpdateFee{
×
30
                ChanID:   chanID,
×
31
                FeePerKw: feePerKw,
×
32
        }
×
33
}
×
34

35
// A compile time check to ensure UpdateFee implements the lnwire.Message
36
// interface.
37
var _ Message = (*UpdateFee)(nil)
38

39
// A compile time check to ensure UpdateFee implements the
40
// lnwire.SizeableMessage interface.
41
var _ SizeableMessage = (*UpdateFee)(nil)
42

43
// Decode deserializes a serialized UpdateFee message stored in the passed
44
// io.Reader observing the specified protocol version.
45
//
46
// This is part of the lnwire.Message interface.
47
func (c *UpdateFee) Decode(r io.Reader, pver uint32) error {
×
48
        return ReadElements(r,
×
49
                &c.ChanID,
×
50
                &c.FeePerKw,
×
51
                &c.ExtraData,
×
52
        )
×
53
}
×
54

55
// Encode serializes the target UpdateFee into the passed io.Writer
56
// observing the protocol version specified.
57
//
58
// This is part of the lnwire.Message interface.
59
func (c *UpdateFee) Encode(w *bytes.Buffer, pver uint32) error {
×
60
        if err := WriteChannelID(w, c.ChanID); err != nil {
×
61
                return err
×
62
        }
×
63

64
        if err := WriteUint32(w, c.FeePerKw); err != nil {
×
65
                return err
×
66
        }
×
67

68
        return WriteBytes(w, c.ExtraData)
×
69
}
70

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

79
// SerializedSize returns the serialized size of the message in bytes.
80
//
81
// This is part of the lnwire.SizeableMessage interface.
82
func (c *UpdateFee) SerializedSize() (uint32, error) {
×
83
        return MessageSerializedSize(c)
×
84
}
×
85

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