|
46 | 46 | Port: 9000} |
47 | 47 | testAddrs = []net.Addr{testAddr} |
48 | 48 |
|
49 | | - testFeatures = lnwire.NewFeatureVector(nil, lnwire.Features) |
| 49 | + // We enforce TLV payloads for all nodes when blinding paths. |
| 50 | + testFeatures = lnwire.NewFeatureVector( |
| 51 | + lnwire.NewRawFeatureVector(lnwire.TLVOnionPayloadRequired), |
| 52 | + lnwire.Features, |
| 53 | + ) |
50 | 54 |
|
51 | 55 | testTime = time.Date(2018, time.January, 9, 14, 00, 00, 0, time.UTC) |
52 | 56 |
|
@@ -1512,7 +1516,10 @@ func TestBuildRoute(t *testing.T) { |
1512 | 1516 | // Setup a three node network. |
1513 | 1517 | chanCapSat := btcutil.Amount(100000) |
1514 | 1518 | paymentAddrFeatures := lnwire.NewFeatureVector( |
1515 | | - lnwire.NewRawFeatureVector(lnwire.PaymentAddrOptional), |
| 1519 | + lnwire.NewRawFeatureVector( |
| 1520 | + lnwire.PaymentAddrOptional, |
| 1521 | + lnwire.TLVOnionPayloadRequired, |
| 1522 | + ), |
1516 | 1523 | lnwire.Features, |
1517 | 1524 | ) |
1518 | 1525 | testChannels := []*testChannel{ |
@@ -2735,13 +2742,26 @@ func TestAddEdgeUnknownVertexes(t *testing.T) { |
2735 | 2742 | ) |
2736 | 2743 | require.NoError(t, err, "unable to create channel edge") |
2737 | 2744 |
|
| 2745 | + // Before we add the edge, we need to add the nodes to the graph. |
| 2746 | + // Although inserting just an edge will also add a node shell in case |
| 2747 | + // the nodes don't exist yet, we want to make sure that the nodes also |
| 2748 | + // have the proper features set because we now require TLV payloads. |
| 2749 | + require.NoError(t, ctx.graph.AddNode(ctxb, &models.Node{ |
| 2750 | + PubKeyBytes: pub1, |
| 2751 | + Features: testFeatures, |
| 2752 | + })) |
| 2753 | + require.NoError(t, ctx.graph.AddNode(ctxb, &models.Node{ |
| 2754 | + PubKeyBytes: pub2, |
| 2755 | + Features: testFeatures, |
| 2756 | + })) |
| 2757 | + |
2738 | 2758 | edge := &models.ChannelEdgeInfo{ |
2739 | 2759 | ChannelID: chanID.ToUint64(), |
2740 | 2760 | NodeKey1Bytes: pub1, |
2741 | 2761 | NodeKey2Bytes: pub2, |
2742 | 2762 | BitcoinKey1Bytes: pub1, |
2743 | 2763 | BitcoinKey2Bytes: pub2, |
2744 | | - Features: lnwire.EmptyFeatureVector(), |
| 2764 | + Features: testFeatures, |
2745 | 2765 | AuthProof: nil, |
2746 | 2766 | } |
2747 | 2767 | require.NoError(t, ctx.graph.AddChannelEdge(ctxb, edge)) |
@@ -2817,7 +2837,7 @@ func TestAddEdgeUnknownVertexes(t *testing.T) { |
2817 | 2837 |
|
2818 | 2838 | edge = &models.ChannelEdgeInfo{ |
2819 | 2839 | ChannelID: chanID.ToUint64(), |
2820 | | - Features: lnwire.EmptyFeatureVector(), |
| 2840 | + Features: testFeatures, |
2821 | 2841 | AuthProof: nil, |
2822 | 2842 | } |
2823 | 2843 | copy(edge.NodeKey1Bytes[:], node1Bytes) |
|
0 commit comments