mirror of https://github.com/BTCPrivate/lnd.git
fundingmanager: cancel reservation if unable to send initial msg to peer
This commit is contained in:
parent
ff1dc2bbd4
commit
b0d1be282c
|
@ -2436,8 +2436,17 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
|
||||||
ChannelFlags: channelFlags,
|
ChannelFlags: channelFlags,
|
||||||
}
|
}
|
||||||
if err := f.cfg.SendToPeer(peerKey, &fundingOpen); err != nil {
|
if err := f.cfg.SendToPeer(peerKey, &fundingOpen); err != nil {
|
||||||
fndgLog.Errorf("Unable to send funding request message: %v", err)
|
e := fmt.Errorf("Unable to send funding request message: %v",
|
||||||
msg.err <- err
|
err)
|
||||||
|
fndgLog.Errorf(e.Error())
|
||||||
|
|
||||||
|
// Since we were unable to send the initial message to the peer
|
||||||
|
// and start the funding flow, we'll cancel this reservation.
|
||||||
|
if _, err := f.cancelReservationCtx(peerKey, chanID); err != nil {
|
||||||
|
fndgLog.Errorf("unable to cancel reservation: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
msg.err <- e
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue