mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
f494433cbf
In this commit, we introduce a new method to the channel router's config struct: QueryBandwidth. This method allows the channel router to query for the up-to-date available bandwidth of a particular link. In the case that this link emanates from/to us, then we can query the switch to see if the link is active (if not bandwidth is zero), and return the current best estimate for the available bandwidth of the link. If the link, isn't one of ours, then we can thread through the total maximal capacity of the link. In order to implement this, the missionControl struct will now query the switch upon creation to obtain a fresh bandwidth snapshot. We take care to do this in a distinct db transaction in order to now introduced a circular waiting condition between the mutexes in bolt, and the channel state machine. The aim of this change is to reduce the number of unnecessary failures during HTLC payment routing as we'll now skip any links that are inactive, or just don't have enough bandwidth for the payment. Nodes that have several hundred channels (all of which in various states of activity and available bandwidth) should see a nice gain from this w.r.t payment latency. |
||
---|---|---|
.. | ||
chainview | ||
testdata | ||
errors.go | ||
graph.go | ||
heap_test.go | ||
heap.go | ||
log.go | ||
missioncontrol.go | ||
notifications_test.go | ||
notifications.go | ||
pathfind_test.go | ||
pathfind.go | ||
README.md | ||
router_test.go | ||
router.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