From a3e0c9ca0bbae5e155b1f72d986982d788324cfd Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 24 May 2018 23:44:11 -0400 Subject: [PATCH] test: expect sweep txs for both sides in the mempool after csv delay --- lnd_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lnd_test.go b/lnd_test.go index b14205f6..bc838e21 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -7332,23 +7332,25 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest) } assertTxInBlock(t, block, secondLevelHash) - // If we then mine 4 additional blocks, Bob should pull the output - // destined for him. + // If we then mine 4 additional blocks, Bob and Carol should sweep the + // outputs destined for them. if _, err := net.Miner.Node.Generate(defaultCSV); err != nil { t.Fatalf("unable to generate block: %v", err) } - _, err = waitForTxInMempool(net.Miner.Node, time.Second*10) + sweepTxs, err := waitForNTxsInMempool(net.Miner.Node, 2, time.Second*10) if err != nil { - t.Fatalf("unable to find bob's sweeping transaction: %v", err) + t.Fatalf("unable to find sweeping transactions: %v", err) } // At this point, Bob should detect that he has no pending channels // anymore, as this just resolved it by the confirmation of the sweep // transaction we detected above. - if _, err := net.Miner.Node.Generate(1); err != nil { - t.Fatalf("unable to generate block: %v", err) + block = mineBlocks(t, net, 1)[0] + for _, sweepTx := range sweepTxs { + assertTxInBlock(t, block, sweepTx) } + err = lntest.WaitPredicate(func() bool { pendingChanResp, err := net.Bob.PendingChannels( ctxb, pendingChansRequest,