itest: manage context in CloseChannel and AssertChannelExists

This commit is contained in:
yyforyongyu
2021-08-20 01:35:02 +08:00
parent 3e26d77f91
commit 16403da91e
7 changed files with 39 additions and 55 deletions

View File

@@ -856,13 +856,11 @@ func testPrivateChannels(net *lntest.NetworkHarness, t *harnessTest) {
Hash: *fundingTxID,
Index: chanPointPrivate.OutputIndex,
}
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
err = net.AssertChannelExists(ctxt, carol, &privateFundPoint)
err = net.AssertChannelExists(carol, &privateFundPoint)
if err != nil {
t.Fatalf("unable to assert channel existence: %v", err)
}
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
err = net.AssertChannelExists(ctxt, net.Alice, &privateFundPoint)
err = net.AssertChannelExists(net.Alice, &privateFundPoint)
if err != nil {
t.Fatalf("unable to assert channel existence: %v", err)
}
@@ -886,7 +884,7 @@ func testPrivateChannels(net *lntest.NetworkHarness, t *harnessTest) {
time.Sleep(time.Millisecond * 50)
// Let Carol pay the invoices.
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
ctxt, _ := context.WithTimeout(ctxb, defaultTimeout)
err = completePaymentRequests(
ctxt, carol, carol.RouterClient, payReqs, true,
)