funding: check error to avoid panic during test

This commit, the error returned from `getInitialFwdingPolicy` is checked
in order to avoid a nil pointer dereference panic during the
TestFundingManagerCustomChannelParameters test.
This commit is contained in:
Elle Mouton committed 2022-12-22 10:06:42 +02:00
1 parent de3e0d7875
commit d4a49b08f5
3 files changed
+14 -12

No files matched your search

+1 -4
View File
@@ -4439,10 +4439,7 @@ func (f *Manager) getInitialFwdingPolicy(permChanID lnwire.ChannelID) (
chanID := make([]byte, 32)
copy(chanID, permChanID[:])
value, err := f.cfg.Wallet.Cfg.Database.GetInitialFwdingPolicy(
chanID,
)
value, err := f.cfg.Wallet.Cfg.Database.GetInitialFwdingPolicy(chanID)
if err != nil {
return nil, err
}