From 43247eac0bd2661bbf5f23dc60f619d5ec833ccf Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Fri, 22 Nov 2024 23:16:33 +0800 Subject: [PATCH] lntest: fix flakeness in `openChannelsForNodes` We now make sure the channel participants have heard their private channel when opening channels. --- lntest/harness.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lntest/harness.go b/lntest/harness.go index 1dac9a12d8..4ec4b5316e 100644 --- a/lntest/harness.go +++ b/lntest/harness.go @@ -2262,8 +2262,19 @@ func (h *HarnessTest) openChannelsForNodes(nodes []*node.HarnessNode, } resp := h.OpenMultiChannelsAsync(reqs) - // Make sure the nodes know each other's channels if they are public. - if !p.Private { + // If the channels are private, make sure the channel participants know + // the relevant channel. + if p.Private { + for i, chanPoint := range resp { + // Get the channel participants - for n channels we + // would have n+1 nodes. + nodeA, nodeB := nodes[i], nodes[i+1] + h.AssertChannelInGraph(nodeA, chanPoint) + h.AssertChannelInGraph(nodeB, chanPoint) + } + } else { + // Make sure the all nodes know all the channels if they are + // public. for _, node := range nodes { for _, chanPoint := range resp { h.AssertChannelInGraph(node, chanPoint)