From 3e7c69e596555f35f9af1e0b9bb3e929cd66a401 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 24 May 2018 22:55:13 -0400 Subject: [PATCH] Revert "test: account for block race by mining additional block in remote htlc force close test" Before the previous commit, we assumed the HTLC's timeout transaction would be the only transaction in the mempool. In reality, after mining some blocks for the HTLC to expire and waiting for the timeout transaction to arrive in the mempool, at times we would instead detect the funding output's sweeping transaction and proceed the test with this assumption, leading to the case where we would have to mine extra blocks to include the HTLC sweeping transaction. This has been resolved in the previous commit, so this fix is no longer needed. This reverts commit e54f1ea4dbe59b2e53a94774995ae1711746c2f8. --- lnd_test.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lnd_test.go b/lnd_test.go index ed9f0ad7..b9d188ba 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -7127,20 +7127,9 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness, nodes = []*lntest.HarnessNode{net.Alice} err = lntest.WaitPredicate(func() bool { return assertNumActiveHtlcs(nodes, 0) - }, time.Second*8) + }, time.Second*15) if err != nil { - // It may be the case that due to a race, Bob's sweeping - // transaction hasn't yet been confirmed, so we'll mine another - // block to nudge it in. If after this it still Alice will has - // an HTLC, then it's actually a test failure. - if _, err := net.Miner.Node.Generate(1); err != nil { - t.Fatalf("unable to generate block: %v", err) - } - if err = lntest.WaitPredicate(func() bool { - return assertNumActiveHtlcs(nodes, 0) - }, time.Second*8); err != nil { - t.Fatalf("alice's channel still has active htlc's") - } + t.Fatalf("alice's channel still has active htlc's") } // Now we'll check Bob's pending channel report. Since this was Carol's