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

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

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

0.0
/lnwire/warning.go
1
package lnwire
2

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

9
// WarningData is a set of bytes associated with a particular sent warning. A
10
// receiving node SHOULD only print out data verbatim if the string is composed
11
// solely of printable ASCII characters. For reference, the printable character
12
// set includes byte values 32 through 127 inclusive.
13
type WarningData []byte
14

15
// Warning is used to express non-critical errors in the protocol, providing
16
// a "soft" way for nodes to communicate failures.
17
type Warning struct {
18
        // ChanID references the active channel in which the warning occurred
19
        // within. If the ChanID is all zeros, then this warning applies to the
20
        // entire established connection.
21
        ChanID ChannelID
22

23
        // Data is the attached warning data that describes the exact failure
24
        // which caused the warning message to be sent.
25
        Data WarningData
26
}
27

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

32
// NewWarning creates a new Warning message.
33
func NewWarning() *Warning {
×
34
        return &Warning{}
×
35
}
×
36

37
// Warning returns the string representation to Warning.
38
func (c *Warning) Warning() string {
×
39
        errMsg := "non-ascii data"
×
40
        if isASCII(c.Data) {
×
41
                errMsg = string(c.Data)
×
42
        }
×
43

44
        return fmt.Sprintf("chan_id=%v, err=%v", c.ChanID, errMsg)
×
45
}
46

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

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

67
        return WriteWarningData(w, c.Data)
×
68
}
69

70
// MsgType returns the integer uniquely identifying an Warning message on the
71
// wire.
72
//
73
// This is part of the lnwire.Message interface.
74
func (c *Warning) MsgType() MessageType {
×
75
        return MsgWarning
×
76
}
×
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