9781ea0082
The current approach iterates all channels in the graph in order to filter those in need. This approach is time consuming, several seconds on my mobile device for ~40,000 channels, while during this time the db is locked in a transaction. The proposed change is to use an existing functionality that utilize the fact that channel update are saved indexed by date. This method enables us to go over only a small subset of the channels, only those that were updated before the "channel expiry" time and further filter them for our need. The same graph that took several seconds to prune was pruned, after the change, in several milliseconds. In addition for testing purposes I added Initiator field to the testChannel structure to reflect the channeldEdgePolicy direction. |
||
---|---|---|
.. | ||
chainview | ||
route | ||
testdata | ||
ann_validation.go | ||
conf_experimental.go | ||
conf.go | ||
control_tower_test.go | ||
control_tower.go | ||
errors.go | ||
graph.go | ||
heap_test.go | ||
heap.go | ||
log.go | ||
missioncontrol_test.go | ||
missioncontrol.go | ||
mock_test.go | ||
notifications_test.go | ||
notifications.go | ||
pathfind_test.go | ||
pathfind.go | ||
payment_lifecycle.go | ||
payment_session_test.go | ||
payment_session.go | ||
README.md | ||
router_test.go | ||
router.go | ||
stats.go | ||
validation_barrier_test.go | ||
validation_barrier.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