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.
This commit is contained in:
parent
84fcf5b12f
commit
3e7c69e596
15
lnd_test.go
15
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
|
||||
|
Loading…
Reference in New Issue
Block a user