From aefc23938cea1aa6e6441517a2615940a1684f32 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 6 Feb 2019 21:47:41 +0100 Subject: [PATCH] lnd_test: assert num channels before state check Since the getChanInfo call would require the node to have only one channel, it made no sense to check the number of channels after calling it. Instead we check it first, giving the node time to restart. --- lnd_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lnd_test.go b/lnd_test.go index fb3bf82c..bb0bffef 100644 --- a/lnd_test.go +++ b/lnd_test.go @@ -7665,6 +7665,10 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) { t.Fatalf("unable to restart node: %v", err) } + // Make sure the channel is still there from the PoV of the + // node. + assertNodeNumChannels(t, node, 1) + // Now query for the channel state, it should show that it's at // a state number in the past, not the *latest* state. ctxt, _ = context.WithTimeout(ctxb, defaultTimeout) @@ -7675,7 +7679,6 @@ func testDataLossProtection(net *lntest.NetworkHarness, t *harnessTest) { if nodeChan.NumUpdates != stateNumPreCopy { t.Fatalf("db copy failed: %v", nodeChan.NumUpdates) } - assertNodeNumChannels(t, node, 1) balReq := &lnrpc.WalletBalanceRequest{} ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)