mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-29 10:09:08 +02:00
routing: also include the source node in the nextHopMap index
In this commit we modify the newRoute function to also add the source node to the nextHopMap index. With this addition the indexes will now allow the router to react based on failures that occur during the _first_ hop, meaning the channel directly attached to the source node.
This commit is contained in:
@ -303,6 +303,7 @@ func TestBasicGraphPathFinding(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to fetch source node: %v", err)
|
||||
}
|
||||
sourceVertex := newVertex(sourceNode.PubKey)
|
||||
|
||||
ignoredEdges := make(map[uint64]struct{})
|
||||
ignoredVertexes := make(map[vertex]struct{})
|
||||
@ -320,7 +321,7 @@ func TestBasicGraphPathFinding(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find path: %v", err)
|
||||
}
|
||||
route, err := newRoute(paymentAmt, path, startingHeight)
|
||||
route, err := newRoute(paymentAmt, sourceVertex, path, startingHeight)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create path: %v", err)
|
||||
}
|
||||
@ -416,7 +417,7 @@ func TestBasicGraphPathFinding(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unable to find route: %v", err)
|
||||
}
|
||||
route, err = newRoute(paymentAmt, path, startingHeight)
|
||||
route, err = newRoute(paymentAmt, sourceVertex, path, startingHeight)
|
||||
if err != nil {
|
||||
t.Fatalf("unable to create path: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user