5442e42cc1
This commit fixes a pretty nasty unnoticed bug within the main k-shortest paths algorithm loop. After a new candidate path is found, the rootPath (the path up to the pivot node) and the spurPath (the _new_ path after the pivot node) are to be combined into a new candiate shortest path. The prior logic simply appended the spurPath onto the end of the rootPath to create a slice. However, if the case that the currnet rootPath is really a sub-path in a larger slice, then this will mutate the underlying slice. This bug would manifest when doing path finding and cause an infinite loop as the slice kept growing with new spurPaths, causing the loop to never terminate. We remedy this bug by properly create a new backing slice, and adding the elements to them rather than incorrectly mutating an underlying slice. |
||
---|---|---|
.. | ||
testdata | ||
errors.go | ||
graph.go | ||
heap_test.go | ||
heap.go | ||
log.go | ||
notifications_test.go | ||
notifications.go | ||
pathfind_test.go | ||
pathfind.go | ||
README.md | ||
router_test.go | ||
router.go |
routing
The routing package implements authentication+validation of channel announcements, pruning of the channel graph, path finding within the network, sending outgoing payments into the network and synchronizing new peers to our channel graph state.
Installation and Updating
$ go get -u github.com/lightningnetwork/lnd/routing