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

lightningnetwork / lnd / 16277065588

14 Jul 2025 08:24PM UTC coverage: 57.625% (-9.7%) from 67.339%
16277065588

Pull #9993

github

web-flow
Merge c91033ae4 into 5bb227774
Pull Request #9993: Validate UTF-8 description and empty route hints when parsing BOLT-11 invoices

2 of 7 new or added lines in 1 file covered. (28.57%)

28404 existing lines in 457 files now uncovered.

98663 of 171215 relevant lines covered (57.63%)

1.79 hits per line

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

72.41
/input/txout.go
1
package input
2

3
import (
4
        "encoding/binary"
5
        "io"
6

7
        "github.com/btcsuite/btcd/wire"
8
)
9

10
// writeTxOut serializes a wire.TxOut struct into the passed io.Writer stream.
11
func writeTxOut(w io.Writer, txo *wire.TxOut) error {
3✔
12
        var scratch [8]byte
3✔
13

3✔
14
        binary.BigEndian.PutUint64(scratch[:], uint64(txo.Value))
3✔
15
        if _, err := w.Write(scratch[:]); err != nil {
3✔
16
                return err
×
17
        }
×
18

19
        if err := wire.WriteVarBytes(w, 0, txo.PkScript); err != nil {
3✔
20
                return err
×
21
        }
×
22

23
        return nil
3✔
24
}
25

26
// readTxOut deserializes a wire.TxOut struct from the passed io.Reader stream.
27
func readTxOut(r io.Reader, txo *wire.TxOut) error {
3✔
28
        var scratch [8]byte
3✔
29

3✔
30
        if _, err := io.ReadFull(r, scratch[:]); err != nil {
3✔
31
                return err
×
32
        }
×
33
        value := int64(binary.BigEndian.Uint64(scratch[:]))
3✔
34

3✔
35
        pkScript, err := wire.ReadVarBytes(r, 0, 80, "pkScript")
3✔
36
        if err != nil {
3✔
UNCOV
37
                return err
×
UNCOV
38
        }
×
39

40
        *txo = wire.TxOut{
3✔
41
                Value:    value,
3✔
42
                PkScript: pkScript,
3✔
43
        }
3✔
44

3✔
45
        return nil
3✔
46
}
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