lntest: nil check edges

This commit is contained in:
Elle Mouton 2024-11-18 21:06:06 +02:00
parent 0876173c45
commit 90ed0fe54c
No known key found for this signature in database
GPG Key ID: D7D916376026F177
2 changed files with 4 additions and 4 deletions

View File

@ -255,10 +255,10 @@ func (h *HarnessTest) AssertNumActiveEdges(hn *node.HarnessNode,
// filterDisabled is a helper closure that filters out disabled
// channels.
filterDisabled := func(edge *lnrpc.ChannelEdge) bool {
if edge.Node1Policy.Disabled {
if edge.Node1Policy != nil && edge.Node1Policy.Disabled {
return false
}
if edge.Node2Policy.Disabled {
if edge.Node2Policy != nil && edge.Node2Policy.Disabled {
return false
}

View File

@ -312,10 +312,10 @@ func (s *State) updateEdgeStats() {
// filterDisabled is a helper closure that filters out disabled
// channels.
filterDisabled := func(edge *lnrpc.ChannelEdge) bool {
if edge.Node1Policy.Disabled {
if edge.Node1Policy != nil && edge.Node1Policy.Disabled {
return false
}
if edge.Node2Policy.Disabled {
if edge.Node2Policy != nil && edge.Node2Policy.Disabled {
return false
}