From 3f3656ae4af8b20ae301253c94e2ea8009116dbd Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 6 Feb 2019 21:47:40 +0100 Subject: [PATCH] lnd_test: assert htlc sweep is mined To ensure the sweep has properly propagated to the miner and included in the mined block. --- lnd_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lnd_test.go b/lnd_test.go index 194f692c..ee0becfc 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -3056,7 +3056,9 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) { } // Wait for the single sweep txn to appear in the mempool. - htlcSweepTxID, err := waitForTxInMempool(net.Miner.Node, minerMempoolTimeout) + htlcSweepTxID, err := waitForTxInMempool( + net.Miner.Node, minerMempoolTimeout, + ) if err != nil { t.Fatalf("failed to get sweep tx from mempool: %v", err) } @@ -3152,11 +3154,9 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) { } // Generate the final block that sweeps all htlc funds into the user's - // wallet. - blockHash, err = net.Miner.Node.Generate(1) - if err != nil { - t.Fatalf("unable to generate block: %v", err) - } + // wallet, and make sure the sweep is in this block. + block = mineBlocks(t, net, 1, 1)[0] + assertTxInBlock(t, block, htlcSweepTxID) // Now that the channel has been fully swept, it should no longer show // up within the pending channels RPC.