Skip to content

Commit 64fb4cb

Browse files
committed
itest: fix blinded path itest.
1 parent 1bf7ad9 commit 64fb4cb

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

itest/lnd_route_blinding_test.go

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,12 +1471,37 @@ func testBlindedPaymentHTLCReForward(ht *lntest.HarnessTest) {
14711471
_, err := testCase.carolInterceptor.Recv()
14721472
require.NoError(ht, err)
14731473

1474-
// Now, restart Carol. This time, don't require an interceptor. This
1475-
// means that Carol should load up any previously persisted
1476-
// UpdateAddHTLC messages and continue the processing of them.
1477-
ht.RestartNodeWithExtraArgs(
1478-
testCase.carol, []string{"--bitcoin.timelockdelta=18"},
1474+
// Now, restart Carol. Carol should load up any previously persisted
1475+
// UpdateAddHTLC messages and continue the processing of them. This
1476+
// time, again with an interceptor because we need to make sure that
1477+
// the HTLC is forwarded after the nodes carol-dave are connected
1478+
// and their channel active. Otherwise the reforwarding of the HTLC
1479+
// would fail.
1480+
ht.RestartNode(testCase.carol)
1481+
1482+
// Register the client for the interceptor because the previous one
1483+
// closed during the restart.
1484+
carolInterceptor, err := testCase.carol.RPC.Router.HtlcInterceptor(
1485+
ctx,
14791486
)
1487+
require.NoError(ht, err, "interceptor")
1488+
1489+
// Intercept the replayed forward on Carol's link again.
1490+
carolHTLC, err := carolInterceptor.Recv()
1491+
require.NoError(ht, err)
1492+
1493+
// Nodes need to be connected otherwise the forwarding of the
1494+
// intercepted htlc will fail.
1495+
ht.EnsureConnected(ht.Bob, testCase.carol)
1496+
ht.EnsureConnected(testCase.carol, testCase.dave)
1497+
1498+
// Now that carol and dave are connected signal the forwarding of the
1499+
// HTLC.
1500+
err = carolInterceptor.Send(&routerrpc.ForwardHtlcInterceptResponse{
1501+
IncomingCircuitKey: carolHTLC.IncomingCircuitKey,
1502+
Action: routerrpc.ResolveHoldForwardAction_RESUME,
1503+
})
1504+
require.NoError(ht, err)
14801505

14811506
// Now, wait for the payment to complete.
14821507
select {

0 commit comments

Comments
 (0)