lnd.xprv/routing
Olaoluwa Osuntokun a7fe7ae941
routing: correct miscalculation multi-hop onion payload fees
In this commit we fix an existing miscalculation in the fees that we
prescribe within the onion payloads for multi-hop routes. Before this
commit, if a route had more than 3 hops, then we would erroneously give
the second to last hop zero fees.

In this commit we correct this behavior, and also re-write the fee
calculation code fragment within newRoute for readability and clarity.
There are now only two cases: this is the last hop, and this is any
other hop. In the case of the last hop, simply send the exact amount
with no additional fee. In the case of an intermediate hop, we use the
_prior_ (closer to the destination) hop to calculate the amount of fees
we need, which allows us to compute the incoming flow. Using that
incoming flow, we then can compute the amount that the hop should
forward out.

Partially fixes #391.
2017-10-24 18:27:35 -07:00
..
chainview routing/chainview: Fix data race in block disconnected callback. 2017-09-29 13:53:02 -07:00
testdata routing/testdata: modify spec example to set bob as initial source node 2017-10-22 18:36:58 -07:00
errors.go routing: Require adding edge to node before adding node. 2017-08-02 15:58:58 -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: replace sort.Sort with sort.Slice in heap_test.go 2017-10-02 23:13:47 -07:00
heap.go routing: introduce new heap for storing candidate shortest paths 2017-03-21 12:20:30 -07:00
log.go lnd: remove seelog logger 2017-06-25 14:19:56 +01:00
missioncontrol.go routing: extend missionControl.RequestRoute to take final CLTV delta 2017-10-22 18:36:58 -07:00
notifications_test.go multi: Update lnd to use new feature vector API. 2017-10-17 22:47:20 -07:00
notifications.go routing: update path finding and notifications to use mSAT 2017-08-22 00:53:12 -07:00
pathfind_test.go routing: restore in memory selfNode within the ChannelRouter 2017-10-22 18:36:59 -07:00
pathfind.go routing: correct miscalculation multi-hop onion payload fees 2017-10-24 18:27:35 -07:00
README.md multi: fix formatting issues in packge README's 2017-03-27 16:25:25 -07:00
router_test.go routing: update tests in router_test.go to pass in new param to FindRoutes 2017-10-22 18:36:52 -07:00
router.go routing: modify applyChannelUpdate to not error out if update is stale 2017-10-24 18:23:04 -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