mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-13 10:21:37 +02:00
peer: hand lnwire.Error to fndgMngr or link depending on chanID
This commit is contained in:
parent
33762e0f81
commit
80ef16e853
22
peer.go
22
peer.go
@ -748,7 +748,27 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
case *lnwire.Error:
|
case *lnwire.Error:
|
||||||
p.server.fundingMgr.processFundingError(msg, p.addr)
|
switch {
|
||||||
|
|
||||||
|
// In the case of an all-zero channel ID we want to
|
||||||
|
// forward the error to all channels with this peer.
|
||||||
|
case msg.ChanID == lnwire.ConnectionWideID:
|
||||||
|
for _, chanStream := range chanMsgStreams {
|
||||||
|
chanStream.AddMsg(nextMsg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the channel ID for the error message corresponds
|
||||||
|
// to a pending channel, then the funding manager will
|
||||||
|
// handle the error.
|
||||||
|
case p.server.fundingMgr.IsPendingChannel(msg.ChanID, p.addr):
|
||||||
|
p.server.fundingMgr.processFundingError(msg, p.addr)
|
||||||
|
|
||||||
|
// If not we hand the error to the channel link for
|
||||||
|
// this channel.
|
||||||
|
default:
|
||||||
|
isChanUpdate = true
|
||||||
|
targetChan = msg.ChanID
|
||||||
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): create ChanUpdater interface for the below
|
// TODO(roasbeef): create ChanUpdater interface for the below
|
||||||
case *lnwire.UpdateAddHTLC:
|
case *lnwire.UpdateAddHTLC:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user