routing: weight findPath more heavily towards fees during edge relaxation

In this commit, we modify the edgeWeight function that’s used within
the findPath method to weight fees more heavily than the time lock
value at an edge. We do this in order to greedily prefer lower fees
during path finding. This is a simple stop gap in place of more complex
weighting parameters that will be investigated later.

We also modify the edge distance to use an int64 rather than a float.
Finally an additional test has been added in order to excessive this
new change. Before the commit, the test was failing as we preferred the
route with lower total time lock.
This commit is contained in:
Olaoluwa Osuntokun
2018-02-12 16:27:30 -08:00
parent ad0f5b31f6
commit 528aa67df7
5 changed files with 87 additions and 12 deletions

View File

@ -7,7 +7,7 @@ import "github.com/lightningnetwork/lnd/channeldb"
type nodeWithDist struct {
// dist is the distance to this node from the source node in our
// current context.
dist float64
dist int64
// node is the vertex itself. This pointer can be used to explore all
// the outgoing edges (channels) emanating from a node.