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:
9 files changed
+158
-50
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user