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

lightningnetwork / lnd / 19155841408

07 Nov 2025 02:03AM UTC coverage: 66.675% (-0.04%) from 66.712%
19155841408

Pull #10352

github

web-flow
Merge e4313eba8 into 096ab65b1
Pull Request #10352: [WIP] chainrpc: return Unavailable while notifier starts

137328 of 205965 relevant lines covered (66.68%)

21333.36 hits per line

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

83.33
/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 {
587✔
20
        return tlv.MakeStaticRecord(0, o, 34, outpointEncoder, outpointDecoder)
587✔
21
}
587✔
22

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

232✔
33
                return err
232✔
34
        }
35

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

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

47
                *v = OutPoint(o)
228✔
48

228✔
49
                return nil
228✔
50
        }
51

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