mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 18:10:34 +01:00
fundingmanager: properly stop channel on error
This commit is contained in:
parent
55c8741e42
commit
b56d922ce2
@ -1616,9 +1616,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
|
||||
fndgLog.Errorf("failed creating lnChannel: %v", err)
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
lnChannel.Stop()
|
||||
}()
|
||||
defer lnChannel.Stop()
|
||||
|
||||
err = f.sendFundingLocked(completeChan, lnChannel, shortChanID)
|
||||
if err != nil {
|
||||
@ -1879,9 +1877,7 @@ func (f *fundingManager) handleFundingConfirmation(completeChan *channeldb.OpenC
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
lnChannel.Stop()
|
||||
}()
|
||||
defer lnChannel.Stop()
|
||||
|
||||
chanID := lnwire.NewChanIDFromOutPoint(&completeChan.FundingOutpoint)
|
||||
|
||||
@ -2224,6 +2220,7 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
|
||||
err = channel.InitNextRevocation(fmsg.msg.NextPerCommitmentPoint)
|
||||
if err != nil {
|
||||
fndgLog.Errorf("unable to insert next commitment point: %v", err)
|
||||
channel.Stop()
|
||||
return
|
||||
}
|
||||
|
||||
@ -2249,6 +2246,7 @@ func (f *fundingManager) handleFundingLocked(fmsg *fundingLockedMsg) {
|
||||
peer, err := f.cfg.FindPeer(fmsg.peerAddress.IdentityKey)
|
||||
if err != nil {
|
||||
fndgLog.Errorf("Unable to find peer: %v", err)
|
||||
channel.Stop()
|
||||
return
|
||||
}
|
||||
newChanDone := make(chan struct{})
|
||||
|
Loading…
Reference in New Issue
Block a user