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.
This commit is contained in:
Johan T. Halseth 2019-02-06 21:47:41 +01:00
parent b19b26003b
commit aefc23938c
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -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)