mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 15:53:04 +02:00
routing: assume TLV payloads everywhere
This commit removes another check for TLV payload support of the destination node. We assume TLV payloads as the default everywhere else, so we just remove two checks that were previously forgotten.
This commit is contained in:
committed by
Elle Mouton
parent
ce813276d5
commit
b300da8446
@@ -882,13 +882,6 @@ func runFindPathWithMetadata(t *testing.T, useCache bool) {
|
||||
|
||||
_, err = ctx.findPath(target, paymentAmt)
|
||||
require.ErrorIs(t, errNoPathFound, err)
|
||||
|
||||
// Assert that tlv payload support takes precedence over metadata
|
||||
// issues.
|
||||
ctx.restrictParams.DestFeatures = lnwire.EmptyFeatureVector()
|
||||
|
||||
_, err = ctx.findPath(target, paymentAmt)
|
||||
require.ErrorIs(t, errNoTlvPayload, err)
|
||||
}
|
||||
|
||||
// runFindLowestFeePath tests that out of two routes with identical total
|
||||
@@ -1261,20 +1254,6 @@ func runPathFindingWithAdditionalEdges(t *testing.T, useCache bool) {
|
||||
restrictions := *noRestrictions
|
||||
restrictions.DestCustomRecords = record.CustomSet{70000: []byte{}}
|
||||
|
||||
_, err = find(&restrictions)
|
||||
if err != errNoTlvPayload {
|
||||
t.Fatalf("path shouldn't have been found: %v", err)
|
||||
}
|
||||
|
||||
// Set empty dest features so we don't try the fallback. We should still
|
||||
// fail since the tlv feature isn't set.
|
||||
restrictions.DestFeatures = lnwire.EmptyFeatureVector()
|
||||
|
||||
_, err = find(&restrictions)
|
||||
if err != errNoTlvPayload {
|
||||
t.Fatalf("path shouldn't have been found: %v", err)
|
||||
}
|
||||
|
||||
// Finally, set the tlv feature in the payload and assert we found the
|
||||
// same path as before.
|
||||
restrictions.DestFeatures = tlvFeatures
|
||||
@@ -1775,31 +1754,12 @@ func runDestTLVGraphFallback(t *testing.T, useCache bool) {
|
||||
// Add custom records w/o any dest features.
|
||||
restrictions.DestCustomRecords = record.CustomSet{70000: []byte{}}
|
||||
|
||||
// Path to luoji should fail because his node ann features are empty.
|
||||
_, err = find(&restrictions, luoji)
|
||||
if err != errNoTlvPayload {
|
||||
t.Fatalf("path shouldn't have been found: %v", err)
|
||||
}
|
||||
|
||||
// However, path to satoshi should succeed via the fallback because his
|
||||
// node ann features have the TLV bit.
|
||||
path, err := find(&restrictions, satoshi)
|
||||
require.NoError(t, err, "path should have been found")
|
||||
assertExpectedPath(t, ctx.testGraphInstance.aliasMap, path, "satoshi")
|
||||
|
||||
// Add empty destination features. This should cause both paths to fail,
|
||||
// since this override anything in the graph.
|
||||
restrictions.DestFeatures = lnwire.EmptyFeatureVector()
|
||||
|
||||
_, err = find(&restrictions, luoji)
|
||||
if err != errNoTlvPayload {
|
||||
t.Fatalf("path shouldn't have been found: %v", err)
|
||||
}
|
||||
_, err = find(&restrictions, satoshi)
|
||||
if err != errNoTlvPayload {
|
||||
t.Fatalf("path shouldn't have been found: %v", err)
|
||||
}
|
||||
|
||||
// Finally, set the TLV dest feature. We should succeed in finding a
|
||||
// path to luoji.
|
||||
restrictions.DestFeatures = tlvFeatures
|
||||
|
Reference in New Issue
Block a user