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

lightningnetwork / lnd / 13211764208

08 Feb 2025 03:08AM UTC coverage: 49.288% (-9.5%) from 58.815%
13211764208

Pull #9489

github

calvinrzachman
itest: verify switchrpc server enforces send then track

We prevent the rpc server from allowing onion dispatches for
attempt IDs which have already been tracked by rpc clients.

This helps protect the client from leaking a duplicate onion
attempt. NOTE: This is not the only method for solving this
issue! The issue could be addressed via careful client side
programming which accounts for the uncertainty and async
nature of dispatching onions to a remote process via RPC.
This would require some lnd ChannelRouter changes for how
we intend to use these RPCs though.
Pull Request #9489: multi: add BuildOnion, SendOnion, and TrackOnion RPCs

474 of 990 new or added lines in 11 files covered. (47.88%)

27321 existing lines in 435 files now uncovered.

101192 of 205306 relevant lines covered (49.29%)

1.54 hits per line

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

66.67
/lnwire/netaddress.go
1
package lnwire
2

3
import (
4
        "fmt"
5
        "net"
6

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

11
// NetAddress represents information pertaining to the identity and network
12
// reachability of a peer. Information stored includes the node's identity
13
// public key for establishing a confidential+authenticated connection, the
14
// service bits it supports, and a TCP address the node is reachable at.
15
//
16
// TODO(roasbeef): merge with LinkNode in some fashion
17
type NetAddress struct {
18
        // IdentityKey is the long-term static public key for a node. This node is
19
        // used throughout the network as a node's identity key. It is used to
20
        // authenticate any data sent to the network on behalf of the node, and
21
        // additionally to establish a confidential+authenticated connection with
22
        // the node.
23
        IdentityKey *btcec.PublicKey
24

25
        // Address is the IP address and port of the node. This is left
26
        // general so that multiple implementations can be used.
27
        Address net.Addr
28

29
        // ChainNet is the Bitcoin network this node is associated with.
30
        // TODO(roasbeef): make a slice in the future for multi-chain
31
        ChainNet wire.BitcoinNet
32
}
33

34
// A compile time assertion to ensure that NetAddress meets the net.Addr
35
// interface.
36
var _ net.Addr = (*NetAddress)(nil)
37

38
// String returns a human readable string describing the target NetAddress. The
39
// current string format is: <pubkey>@host.
40
//
41
// This part of the net.Addr interface.
42
func (n *NetAddress) String() string {
3✔
43
        // TODO(roasbeef): use base58?
3✔
44
        pubkey := n.IdentityKey.SerializeCompressed()
3✔
45

3✔
46
        return fmt.Sprintf("%x@%v", pubkey, n.Address)
3✔
47
}
3✔
48

49
// Network returns the name of the network this address is bound to.
50
//
51
// This part of the net.Addr interface.
UNCOV
52
func (n *NetAddress) Network() string {
×
UNCOV
53
        return n.Address.Network()
×
UNCOV
54
}
×
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