lntest: make sure policies are populated in AssertChannelInGraph

This commit is contained in:
yyforyongyu 2024-11-21 22:31:13 +08:00
parent c97c31a70b
commit 77b2fa0271
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

View File

@ -1859,6 +1859,18 @@ func (h *HarnessTest) AssertChannelInGraph(hn *node.HarnessNode,
op, err)
}
// Make sure the policies are populated, otherwise this edge
// cannot be used for routing.
if resp.Node1Policy == nil {
return fmt.Errorf("channel %s has no policy1: %w",
op, err)
}
if resp.Node2Policy == nil {
return fmt.Errorf("channel %s has no policy2: %w",
op, err)
}
edge = resp
return nil