multi: ensure all lnwallet.LightningChannel's are stopped

This commit ensures that we always clean up the resources that are
created when a new instance of a lnwallet.LightningChannel is
instantiated. The is necessary due to the sigPool that’s now present as
an internal goroutine.
This commit is contained in:
Olaoluwa Osuntokun 2017-07-31 21:06:55 -07:00
parent f963859524
commit 5425eff09c
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 2 additions and 0 deletions

View File

@ -1090,6 +1090,7 @@ func (f *fundingManager) waitForFundingConfirmation(completeChan *channeldb.Open
fndgLog.Errorf("error creating new lightning channel: %v", err)
return
}
defer channel.Stop()
// Next, we'll send over the funding locked message which marks that we
// consider the channel open by presenting the remote party with our

View File

@ -563,6 +563,7 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
if err != nil {
return err
}
defer channel.Stop()
_, bestHeight, err := r.server.cc.chainIO.GetBestBlock()
if err != nil {