mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
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:
parent
b45deab379
commit
ac0d29580e
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue