routing: backward searching

This commit is contained in:
Joost Jager authored and Olaoluwa Osuntokun committed 2018-08-09 20:23:40 -07:00
1 parent e52d829168
commit 3e7473f4f0
7 files changed
+295 -152

No files matched your search

+12 -1
View File
@@ -1,6 +1,9 @@
package routing
import "github.com/lightningnetwork/lnd/channeldb"
import (
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnwire"
)
// nodeWithDist is a helper struct that couples the distance from the current
// source to a node with a pointer to the node itself.
@@ -12,6 +15,14 @@ type nodeWithDist struct {
// node is the vertex itself. This pointer can be used to explore all
// the outgoing edges (channels) emanating from a node.
node *channeldb.LightningNode
// amountToReceive is the amount that should be received by this node.
// Either as final payment to the final node or as an intermediate
// amount that includes also the fees for subsequent hops.
amountToReceive lnwire.MilliSatoshi
// fee is the fee that this node is charging for forwarding.
fee lnwire.MilliSatoshi
}
// distanceHeap is a min-distance heap that's used within our path finding