mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 04:53:04 +02:00
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:
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
|
||||
@@ -26,6 +27,7 @@ var (
|
||||
ChannelID: 12345,
|
||||
OutgoingTimeLock: 111,
|
||||
AmtToForward: 555,
|
||||
LegacyPayload: true,
|
||||
}
|
||||
|
||||
testRoute = route.Route{
|
||||
@@ -144,7 +146,9 @@ func TestControlTowerSubscribeSuccess(t *testing.T) {
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(result.Route, &attempt.Route) {
|
||||
t.Fatal("unexpected route")
|
||||
t.Fatalf("unexpected route: %v vs %v",
|
||||
spew.Sdump(result.Route),
|
||||
spew.Sdump(attempt.Route))
|
||||
}
|
||||
|
||||
// After the final event, we expect the channel to be closed.
|
||||
|
Reference in New Issue
Block a user