Skip to content

Commit c62a9c2

Browse files
committed
itest: test blinded paths over private channels
1 parent 74e45ec commit c62a9c2

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

itest/lnd_route_blinding_test.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,9 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
884884
// The following graph is created where Dave is the destination node, and he
885885
// will choose Carol as the introduction node. The channel capacities are set in
886886
// such a way that Alice will have to split the payment to dave over both the
887-
// A->B->C-D and A->E->C->D routes.
887+
// A->B->C-D and A->E->C->D routes. The Carol-Dave channel will also be made
888+
// a private channel so that we can test that Dave's private channels are in
889+
// fact being used in the chosen blinded paths.
888890
//
889891
// ---- Bob ---
890892
// / \
@@ -953,24 +955,32 @@ func testMPPToSingleBlindedPath(ht *lntest.HarnessTest) {
953955
},
954956
},
955957
{
958+
// Note that this is a private channel.
956959
Local: carol,
957960
Remote: dave,
958961
Param: lntest.OpenChannelParams{
959-
Amt: paymentAmt * 2,
962+
Amt: paymentAmt * 2,
963+
Private: true,
960964
},
961965
},
962966
}
963967

964968
channelPoints := ht.OpenMultiChannelsAsync(reqs)
965969

966-
// Make sure every node has heard about every channel.
970+
// Make sure every node has heard about every public channel.
967971
for _, hn := range nodes {
968-
for _, cp := range channelPoints {
972+
var numPublic int
973+
for i, cp := range channelPoints {
974+
if reqs[i].Param.Private {
975+
continue
976+
}
977+
978+
numPublic++
969979
ht.AssertTopologyChannelOpen(hn, cp)
970980
}
971981

972-
// Each node should have exactly 5 edges.
973-
ht.AssertNumEdges(hn, len(channelPoints), false)
982+
// Each node should have exactly numPublic edges.
983+
ht.AssertNumEdges(hn, numPublic, false)
974984
}
975985

976986
// Make Dave create an invoice with a blinded path for Alice to pay.

0 commit comments

Comments
 (0)