From d0d0d21573dbaebd9f0389fee88e0ce8d73ab2de Mon Sep 17 00:00:00 2001 From: carla Date: Fri, 23 Apr 2021 08:19:58 +0200 Subject: [PATCH] itest/test: remove hold force close dependency Our aggregate htlc test depends on our previous behavior where recipients would allow channels with pending hold invoice htlcs to force close. Now that we have an expiry watcher to prevent these force closes, we can't rely on this for tests because the recipient will cancel the htlcs back before they expire. --- lntest/itest/lnd_multi-hop_htlc_aggregation_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go b/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go index b1261c15..3c91eed1 100644 --- a/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go +++ b/lntest/itest/lnd_multi-hop_htlc_aggregation_test.go @@ -169,6 +169,12 @@ func testMultiHopHtlcAggregation(net *lntest.NetworkHarness, t *harnessTest, // be cpfp'ed. net.SetFeeEstimate(30000) + // We want Carol's htlcs to expire off-chain to demonstrate bob's force + // close. However, Carol will cancel her invoices to prevent force + // closes, so we shut her down for now. + restartCarol, err := net.SuspendNode(carol) + require.NoError(t.t, err) + // We'll now mine enough blocks to trigger Bob's broadcast of his // commitment transaction due to the fact that the Carol's HTLCs are // about to timeout. With the default outgoing broadcast delta of zero, @@ -225,6 +231,9 @@ func testMultiHopHtlcAggregation(net *lntest.NetworkHarness, t *harnessTest, } } + // Once bob has force closed, we can restart carol. + require.NoError(t.t, restartCarol()) + // Mine a block to confirm the closing transaction. mineBlocks(t, net, 1, expectedTxes)