channeldb: skip nil scheduler options
This is a robustness option to ensure LND doesn't crash when this function is accidentally called with `AddChannelEdge(edge, nil)`.
This commit is contained in:
1 file changed
+4
@@ -1023,6 +1023,10 @@ func (c *ChannelGraph) AddChannelEdge(edge *models.ChannelEdgeInfo,
|
||||
}
|
||||
|
||||
for _, f := range op {
|
||||
if f == nil {
|
||||
return fmt.Errorf("nil scheduler option was used")
|
||||
}
|
||||
|
||||
f(r)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user