test: wait for 2 transactions to enter mempool at the end of testMultiHopHtlcRemoteChainClaim

In this commit, we fix an existing flake on Travis related to the new
set of on-chain HTLC tests. In this timing flake, Bob would broadcast
his sweeping transaction, but *mid block mining*. As a result, the
output would never be properly swept, needing an additional block to be
mined. We’ll now wait for both Bob’s sweeping transaction, and Carol’s
sweep transaction to be confirmed before we attempt our assertions.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-01-23 19:05:36 -08:00
1 parent 5dc0d669a6
commit 2d104b7ec0
2 files changed
+13 -9

No files matched your search

+1 -1
View File
@@ -6233,7 +6233,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
// With the block mined above, Bob should detect that Carol is
// attempting to sweep the HTLC on-chain, and should obtain the
// preimage.
_, err = waitForTxInMempool(net.Miner.Node, time.Second*10)
_, err = waitForNTxsInMempool(net.Miner.Node, 2, time.Second*15)
if err != nil {
t.Fatalf("unable to find bob's sweeping transaction")
}