mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 14:45:23 +01:00
htlcswitch: fix panic when receiving close req for unknown channel
This commit is contained in:
parent
12f69692aa
commit
00a4da3b8c
@ -658,8 +658,13 @@ func (h *htlcSwitch) handleCloseLink(req *closeLinkReq) {
|
||||
// channel's available bandwidth by the delta specified within the message.
|
||||
func (h *htlcSwitch) handleLinkUpdate(req *linkInfoUpdateMsg) {
|
||||
h.chanIndexMtx.RLock()
|
||||
link := h.chanIndex[*req.targetLink]
|
||||
link, ok := h.chanIndex[*req.targetLink]
|
||||
h.chanIndexMtx.RUnlock()
|
||||
if !ok {
|
||||
hswcLog.Errorf("received link update for non-existent link: %v",
|
||||
req.targetLink)
|
||||
return
|
||||
}
|
||||
|
||||
atomic.AddInt64(&link.availableBandwidth, int64(req.bandwidthDelta))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user