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

lightningnetwork / lnd / 12375116696

17 Dec 2024 02:29PM UTC coverage: 58.366% (-0.2%) from 58.595%
12375116696

Pull #8777

github

ziggie1984
docs: add release-notes
Pull Request #8777: multi: make deletion of edge atomic.

132 of 177 new or added lines in 6 files covered. (74.58%)

670 existing lines in 37 files now uncovered.

133926 of 229458 relevant lines covered (58.37%)

19223.6 hits per line

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

68.75
/lnwire/pong.go
1
package lnwire
2

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

9
// MaxPongBytes is the maximum number of extra bytes a pong can be requested to
10
// send. The type of the message (19) takes 2 bytes, the length field takes up
11
// 2 bytes, leaving 65531 bytes.
12
const MaxPongBytes = 65531
13

14
// ErrMaxPongBytesExceeded indicates that the NumPongBytes field from the ping
15
// message has exceeded MaxPongBytes.
16
var ErrMaxPongBytesExceeded = fmt.Errorf("pong bytes exceeded")
17

18
// PongPayload is a set of opaque bytes sent in response to a ping message.
19
type PongPayload []byte
20

21
// Pong defines a message which is the direct response to a received Ping
22
// message. A Pong reply indicates that a connection is still active. The Pong
23
// reply to a Ping message should contain the nonce carried in the original
24
// Pong message.
25
type Pong struct {
26
        // PongBytes is a set of opaque bytes that corresponds to the
27
        // NumPongBytes defined in the ping message that this pong is
28
        // replying to.
29
        PongBytes PongPayload
30
}
31

32
// NewPong returns a new Pong message.
UNCOV
33
func NewPong(pongBytes []byte) *Pong {
×
UNCOV
34
        return &Pong{
×
UNCOV
35
                PongBytes: pongBytes,
×
UNCOV
36
        }
×
UNCOV
37
}
×
38

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

42
// Decode deserializes a serialized Pong message stored in the passed io.Reader
43
// observing the specified protocol version.
44
//
45
// This is part of the lnwire.Message interface.
46
func (p *Pong) Decode(r io.Reader, pver uint32) error {
109✔
47
        return ReadElements(r,
109✔
48
                &p.PongBytes,
109✔
49
        )
109✔
50
}
109✔
51

52
// Encode serializes the target Pong into the passed io.Writer observing the
53
// protocol version specified.
54
//
55
// This is part of the lnwire.Message interface.
56
func (p *Pong) Encode(w *bytes.Buffer, pver uint32) error {
103✔
57
        return WritePongPayload(w, p.PongBytes)
103✔
58
}
103✔
59

60
// MsgType returns the integer uniquely identifying this message type on the
61
// wire.
62
//
63
// This is part of the lnwire.Message interface.
64
func (p *Pong) MsgType() MessageType {
103✔
65
        return MsgPong
103✔
66
}
103✔
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