• 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

70.0
/netann/sign.go
1
package netann
2

3
import (
4
        "fmt"
5

6
        "github.com/lightningnetwork/lnd/input"
7
        "github.com/lightningnetwork/lnd/keychain"
8
        "github.com/lightningnetwork/lnd/lnwallet"
9
        "github.com/lightningnetwork/lnd/lnwire"
10
)
11

12
// SignAnnouncement signs any type of gossip message that is announced on the
13
// network.
14
func SignAnnouncement(signer lnwallet.MessageSigner, keyLoc keychain.KeyLocator,
15
        msg lnwire.Message) (input.Signature, error) {
3✔
16

3✔
17
        var (
3✔
18
                data []byte
3✔
19
                err  error
3✔
20
        )
3✔
21

3✔
22
        switch m := msg.(type) {
3✔
UNCOV
23
        case *lnwire.ChannelAnnouncement1:
×
UNCOV
24
                data, err = m.DataToSign()
×
25
        case *lnwire.ChannelUpdate1:
3✔
26
                data, err = m.DataToSign()
3✔
27
        case *lnwire.NodeAnnouncement:
3✔
28
                data, err = m.DataToSign()
3✔
29
        default:
×
30
                return nil, fmt.Errorf("can't sign %T message", m)
×
31
        }
32
        if err != nil {
3✔
33
                return nil, fmt.Errorf("unable to get data to sign: %w", err)
×
34
        }
×
35

36
        return signer.SignMessage(keyLoc, data, true)
3✔
37
}
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