routing: extend path finding to be TLV-EOB aware, allow dest TLV records

In this commit, we extend the path finding to be able to recognize when
a node needs the new TLV format, or the legacy format based on the
feature bits they expose. We also extend the `LightningPayment` struct
to allow the caller to specify an arbitrary set of TLV records which can
be used for a number of use-cases including various variants of
spontaneous payments.
This commit is contained in:
Olaoluwa Osuntokun committed 2019-08-22 18:53:01 -07:00
1 parent 5b4c8ac232
commit 4697cfde30
9 files changed
+158 -50

No files matched your search

+9 -6
View File
@@ -16,13 +16,15 @@ var (
SourcePubKey: route.Vertex{10},
Hops: []*route.Hop{
{
ChannelID: 1,
PubKeyBytes: route.Vertex{11},
AmtToForward: 1000,
ChannelID: 1,
PubKeyBytes: route.Vertex{11},
AmtToForward: 1000,
LegacyPayload: true,
},
{
ChannelID: 2,
PubKeyBytes: route.Vertex{12},
ChannelID: 2,
PubKeyBytes: route.Vertex{12},
LegacyPayload: true,
},
},
}
@@ -167,7 +169,8 @@ func TestMissionControl(t *testing.T) {
// Check whether history snapshot looks sane.
history := ctx.mc.GetHistorySnapshot()
if len(history.Nodes) != 1 {
t.Fatal("unexpected number of nodes")
t.Fatalf("unexpected number of nodes: expected 1 got %v",
len(history.Nodes))
}
if len(history.Pairs) != 1 {