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

lightningnetwork / lnd / 13440912774

20 Feb 2025 05:14PM UTC coverage: 57.697% (-1.1%) from 58.802%
13440912774

Pull #9535

github

guggero
GitHub: remove duplicate caching

Turns out that actions/setup-go starting with @v4 also adds caching.
With that, our cache size on disk has almost doubled, leading to the
GitHub runner running out of space in certain situation.
We fix that by disabling the automated caching since we already have our
own, custom-tailored version.
Pull Request #9535: GitHub: remove duplicate caching

103519 of 179417 relevant lines covered (57.7%)

24825.3 hits per line

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

0.0
/routing/graph.go
1
package routing
2

3
import (
4
        "fmt"
5

6
        "github.com/btcsuite/btcd/btcutil"
7
        graphdb "github.com/lightningnetwork/lnd/graph/db"
8
        "github.com/lightningnetwork/lnd/lnwire"
9
        "github.com/lightningnetwork/lnd/routing/route"
10
)
11

12
// Graph is an abstract interface that provides information about nodes and
13
// edges to pathfinding.
14
type Graph interface {
15
        // ForEachNodeDirectedChannel calls the callback for every channel of
16
        // the given node.
17
        ForEachNodeDirectedChannel(nodePub route.Vertex,
18
                cb func(channel *graphdb.DirectedChannel) error) error
19

20
        // FetchNodeFeatures returns the features of the given node.
21
        FetchNodeFeatures(nodePub route.Vertex) (*lnwire.FeatureVector, error)
22
}
23

24
// GraphSessionFactory can be used to gain access to a graphdb.NodeTraverser
25
// instance which can then be used for a path-finding session. Depending on the
26
// implementation, the session will represent a DB connection where a read-lock
27
// is being held across calls to the backing graph.
28
type GraphSessionFactory interface {
29
        // GraphSession will provide the call-back with access to a
30
        // graphdb.NodeTraverser instance which can be used to perform queries
31
        // against the channel graph.
32
        GraphSession(cb func(graph graphdb.NodeTraverser) error) error
33
}
34

35
// FetchAmountPairCapacity determines the maximal public capacity between two
36
// nodes depending on the amount we try to send.
37
func FetchAmountPairCapacity(graph Graph, source, nodeFrom, nodeTo route.Vertex,
38
        amount lnwire.MilliSatoshi) (btcutil.Amount, error) {
×
39

×
40
        // Create unified edges for all incoming connections.
×
41
        //
×
42
        // Note: Inbound fees are not used here because this method is only used
×
43
        // by a deprecated router rpc.
×
44
        u := newNodeEdgeUnifier(source, nodeTo, false, nil)
×
45

×
46
        err := u.addGraphPolicies(graph)
×
47
        if err != nil {
×
48
                return 0, err
×
49
        }
×
50

51
        edgeUnifier, ok := u.edgeUnifiers[nodeFrom]
×
52
        if !ok {
×
53
                return 0, fmt.Errorf("no edge info for node pair %v -> %v",
×
54
                        nodeFrom, nodeTo)
×
55
        }
×
56

57
        edge := edgeUnifier.getEdgeNetwork(amount, 0)
×
58
        if edge == nil {
×
59
                return 0, fmt.Errorf("no edge for node pair %v -> %v "+
×
60
                        "(amount %v)", nodeFrom, nodeTo, amount)
×
61
        }
×
62

63
        return edge.capacity, nil
×
64
}
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