From d543ff581149b924fc6be2ed07b0eddb5cce0a77 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Wed, 23 May 2018 01:45:55 -0400 Subject: [PATCH] lntest: wait until channel is active within AssertChannelExists In this commit, we fix a race condition where at times we open a channel between two parties and immediately try to send payments over it. At times this would fail due to the channel link not being fully registered in the HTLC switch. --- lntest/harness.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lntest/harness.go b/lntest/harness.go index 45515467..600c7b02 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -998,8 +998,8 @@ func (n *NetworkHarness) WaitForChannelClose(ctx context.Context, } } -// AssertChannelExists asserts that an active channel identified by -// channelPoint is known to exist from the point-of-view of node.. +// AssertChannelExists asserts that an active channel identified by the +// specified channel point exists from the point-of-view of the node. func (n *NetworkHarness) AssertChannelExists(ctx context.Context, node *HarnessNode, chanPoint *wire.OutPoint) error { @@ -1015,7 +1015,7 @@ func (n *NetworkHarness) AssertChannelExists(ctx context.Context, for _, channel := range resp.Channels { if channel.ChannelPoint == chanPoint.String() { - return true + return channel.Active } }