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

lightningnetwork / lnd / 13035292482

29 Jan 2025 03:59PM UTC coverage: 49.3% (-9.5%) from 58.777%
13035292482

Pull #9456

github

mohamedawnallah
docs: update release-notes-0.19.0.md

In this commit, we warn users about the removal
of RPCs `SendToRoute`, `SendToRouteSync`, `SendPayment`,
and `SendPaymentSync` in the next release 0.20.
Pull Request #9456: lnrpc+docs: deprecate warning `SendToRoute`, `SendToRouteSync`, `SendPayment`, and `SendPaymentSync` in Release 0.19

100634 of 204126 relevant lines covered (49.3%)

1.54 hits per line

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

48.0
/graph/ann_validation.go
1
package graph
2

3
import (
4
        "bytes"
5

6
        "github.com/btcsuite/btcd/btcec/v2"
7
        "github.com/btcsuite/btcd/chaincfg/chainhash"
8
        "github.com/go-errors/errors"
9
        "github.com/lightningnetwork/lnd/lnwire"
10
)
11

12
// ValidateNodeAnn validates the node announcement by ensuring that the
13
// attached signature is needed a signature of the node announcement under the
14
// specified node public key.
15
func ValidateNodeAnn(a *lnwire.NodeAnnouncement) error {
3✔
16
        // Reconstruct the data of announcement which should be covered by the
3✔
17
        // signature so we can verify the signature shortly below
3✔
18
        data, err := a.DataToSign()
3✔
19
        if err != nil {
3✔
20
                return err
×
21
        }
×
22

23
        nodeSig, err := a.Signature.ToSignature()
3✔
24
        if err != nil {
3✔
25
                return err
×
26
        }
×
27
        nodeKey, err := btcec.ParsePubKey(a.NodeID[:])
3✔
28
        if err != nil {
3✔
29
                return err
×
30
        }
×
31

32
        // Finally ensure that the passed signature is valid, if not we'll
33
        // return an error so this node announcement can be rejected.
34
        dataHash := chainhash.DoubleHashB(data)
3✔
35
        if !nodeSig.Verify(dataHash, nodeKey) {
3✔
36
                var msgBuf bytes.Buffer
×
37
                if _, err := lnwire.WriteMessage(&msgBuf, a, 0); err != nil {
×
38
                        return err
×
39
                }
×
40

41
                return errors.Errorf("signature on NodeAnnouncement(%x) is "+
×
42
                        "invalid: %x", nodeKey.SerializeCompressed(),
×
43
                        msgBuf.Bytes())
×
44
        }
45

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