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

lightningnetwork / lnd / 17949158775

23 Sep 2025 02:18PM UTC coverage: 66.713% (+0.07%) from 66.647%
17949158775

Pull #10232

github

web-flow
Merge fc770ddb4 into 82f77e542
Pull Request #10232: lnwire: add missing Gossip 1.75 fields and message

491 of 568 new or added lines in 19 files covered. (86.44%)

64 existing lines in 19 files now uncovered.

136915 of 205230 relevant lines covered (66.71%)

21387.93 hits per line

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

75.0
/lnwire/outpoint.go
1
package lnwire
2

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

7
        "github.com/btcsuite/btcd/wire"
8
        "github.com/lightningnetwork/lnd/tlv"
9
)
10

11
// OutPoint describes an outpoint of a transaction via its transaction hash
12
// and the outpoint index. This is a thin wrapper around the wire.OutPoint to
13
// provide TLV encoding/decoding.
14
type OutPoint wire.OutPoint
15

16
// Record returns a TLV record that can be used to encode/decode the OutPoint.
17
//
18
// NOTE: this is part of the tlv.RecordProducer interface.
19
func (o *OutPoint) Record() tlv.Record {
508✔
20
        return tlv.MakeStaticRecord(0, o, 34, outpointEncoder, outpointDecoder)
508✔
21
}
508✔
22

23
// outpointEncoder is a TLV encoder for OutPoint.
24
func outpointEncoder(w io.Writer, val interface{}, _ *[8]byte) error {
211✔
25
        if v, ok := val.(*OutPoint); ok {
422✔
26
                buf := bytes.NewBuffer(nil)
211✔
27
                err := WriteOutPoint(buf, wire.OutPoint(*v))
211✔
28
                if err != nil {
211✔
NEW
29
                        return err
×
NEW
30
                }
×
31
                _, err = w.Write(buf.Bytes())
211✔
32

211✔
33
                return err
211✔
34
        }
35

NEW
36
        return tlv.NewTypeForEncodingErr(val, "OutPoint")
×
37
}
38

39
// outpointDecoder is a TLV decoder for OutPoint.
40
func outpointDecoder(r io.Reader, val interface{}, _ *[8]byte, l uint64) error {
207✔
41
        if v, ok := val.(*OutPoint); ok {
414✔
42
                var o wire.OutPoint
207✔
43
                if err := ReadElement(r, &o); err != nil {
207✔
NEW
44
                        return err
×
NEW
45
                }
×
46

47
                *v = OutPoint(o)
207✔
48

207✔
49
                return nil
207✔
50
        }
51

NEW
52
        return tlv.NewTypeForDecodingErr(val, "OutPoint", l, 34)
×
53
}
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