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

lightningnetwork / lnd / 15736109134

18 Jun 2025 02:46PM UTC coverage: 58.197% (-10.1%) from 68.248%
15736109134

Pull #9752

github

web-flow
Merge d2634a68c into 31c74f20f
Pull Request #9752: routerrpc: reject payment to invoice that don't have payment secret or blinded paths

6 of 13 new or added lines in 2 files covered. (46.15%)

28331 existing lines in 455 files now uncovered.

97860 of 168153 relevant lines covered (58.2%)

1.81 hits per line

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

0.0
/netann/msg_hash.go
1
package netann
2

3
import (
4
        "github.com/btcsuite/btcd/chaincfg/chainhash"
5
)
6

7
// MsgHashTag will prefix the message name and the field name in order to
8
// construct the message tag.
9
const MsgHashTag = "lightning"
10

11
// MsgTag computes the full tag that will be used to prefix a message before
12
// calculating the tagged hash. The tag is constructed as follows:
13
//
14
//        tag = "lightning"||"msg_name"||"field_name"
UNCOV
15
func MsgTag(msgName, fieldName string) []byte {
×
UNCOV
16
        tag := []byte(MsgHashTag)
×
UNCOV
17
        tag = append(tag, []byte(msgName)...)
×
UNCOV
18

×
UNCOV
19
        return append(tag, []byte(fieldName)...)
×
UNCOV
20
}
×
21

22
// MsgHash computes the tagged hash of the given message as follows:
23
//
24
//        tag = "lightning"||"msg_name"||"field_name"
25
//        hash = sha256(sha246(tag) || sha256(tag) || msg)
UNCOV
26
func MsgHash(msgName, fieldName string, msg []byte) *chainhash.Hash {
×
UNCOV
27
        tag := MsgTag(msgName, fieldName)
×
UNCOV
28

×
UNCOV
29
        return chainhash.TaggedHash(tag, msg)
×
UNCOV
30
}
×
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