mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
lntest: fix flakeness in openChannelsForNodes
We now make sure the channel participants have heard their private channel when opening channels.
This commit is contained in:
parent
cfb5713cda
commit
39104c53d4
1 changed files with 17 additions and 2 deletions
|
@ -2262,12 +2262,27 @@ 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 channels.
|
||||
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)
|
||||
}
|
||||
|
||||
// Make sure every node has updated its cached graph
|
||||
// about the edges as indicated in `DescribeGraph`.
|
||||
h.AssertNumEdges(node, len(resp), false)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue