lnd.xprv/routing
Olaoluwa Osuntokun 5442e42cc1
routing: fix slice mutation bug that could result in an infinite loop
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.
2017-04-13 14:48:17 -07:00
..
testdata routing: add proper test for excessive number of hops 2017-02-02 00:24:16 -08:00
errors.go discovery+routing: split 'routing' package on 'routing' and 'discovery' 2017-03-29 19:49:05 -07:00
graph.go routing: rewrite package to conform to BOLT07 and factor in fees+timelocks 2016-12-27 16:44:22 -08:00
heap_test.go routing: introduce a heap to keep track of closest nodes during pathfinding 2017-03-21 12:20:18 -07:00
heap.go routing: introduce new heap for storing candidate shortest paths 2017-03-21 12:20:30 -07:00
log.go routing: rewrite package to conform to BOLT07 and factor in fees+timelocks 2016-12-27 16:44:22 -08:00
notifications_test.go routing: add validation of utxo 2017-03-29 19:49:05 -07:00
notifications.go discovery+routing: split 'routing' package on 'routing' and 'discovery' 2017-03-29 19:49:05 -07:00
pathfind_test.go channeldb: add storing of node signature and add edge signature 2017-03-29 19:49:05 -07:00
pathfind.go routing: fix slice mutation bug that could result in an infinite loop 2017-04-13 14:48:17 -07:00
README.md multi: fix formatting issues in packge README's 2017-03-27 16:25:25 -07:00
router_test.go routing: assert that paths have same length in isSamePath 2017-04-13 14:42:35 -07:00
router.go routing: capitalize first letter of new error messages 2017-04-11 22:02:17 -07:00

routing

Build Status MIT licensed GoDoc

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