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

lightningnetwork / lnd / 15561477203

10 Jun 2025 01:54PM UTC coverage: 58.351% (-10.1%) from 68.487%
15561477203

Pull #9356

github

web-flow
Merge 6440b25db into c6d6d4c0b
Pull Request #9356: lnrpc: add incoming/outgoing channel ids filter to forwarding history request

33 of 36 new or added lines in 2 files covered. (91.67%)

28366 existing lines in 455 files now uncovered.

97715 of 167461 relevant lines covered (58.35%)

1.81 hits per line

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

68.75
/watchtower/wtserver/delete_session.go
1
package wtserver
2

3
import (
4
        "github.com/lightningnetwork/lnd/watchtower/wtdb"
5
        "github.com/lightningnetwork/lnd/watchtower/wtwire"
6
)
7

8
// handleDeleteSession processes a DeleteSession request for a client with given
9
// SessionID. The id is assumed to have been previously authenticated by the
10
// brontide connection.
11
func (s *Server) handleDeleteSession(peer Peer, id *wtdb.SessionID) error {
3✔
12
        var failCode wtwire.DeleteSessionCode
3✔
13

3✔
14
        // Delete all session data associated with id.
3✔
15
        err := s.cfg.DB.DeleteSession(*id)
3✔
16
        switch {
3✔
17
        case err == nil:
3✔
18
                failCode = wtwire.CodeOK
3✔
19

3✔
20
                log.Debugf("Session %s deleted", id)
3✔
21

UNCOV
22
        case err == wtdb.ErrSessionNotFound:
×
UNCOV
23
                failCode = wtwire.DeleteSessionCodeNotFound
×
24

25
        default:
×
26
                failCode = wtwire.CodeTemporaryFailure
×
27
        }
28

29
        return s.replyDeleteSession(peer, id, failCode)
3✔
30
}
31

32
// replyDeleteSession sends a DeleteSessionReply back to the peer containing the
33
// error code resulting from processes a DeleteSession request.
34
func (s *Server) replyDeleteSession(peer Peer, id *wtdb.SessionID,
35
        code wtwire.DeleteSessionCode) error {
3✔
36

3✔
37
        msg := &wtwire.DeleteSessionReply{
3✔
38
                Code: code,
3✔
39
        }
3✔
40

3✔
41
        err := s.sendMessage(peer, msg)
3✔
42
        if err != nil {
3✔
43
                log.Errorf("Unable to send DeleteSessionReply to %s", id)
×
44
        }
×
45

46
        // Return the write error if the request succeeded.
47
        if code == wtwire.CodeOK {
6✔
48
                return err
3✔
49
        }
3✔
50

51
        // Otherwise the request failed, return a connection failure to
52
        // disconnect the client.
UNCOV
53
        return &connFailure{
×
UNCOV
54
                ID:   *id,
×
UNCOV
55
                Code: code,
×
UNCOV
56
        }
×
57
}
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