From bb611e065d70695b6ef91ae5562a3637389da26c Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 21 May 2018 15:04:23 +0200 Subject: [PATCH] peer: don't pass closeCtx to chanCloser --- peer.go | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/peer.go b/peer.go index 9a6b792e..a260a65c 100644 --- a/peer.go +++ b/peer.go @@ -1572,18 +1572,6 @@ func (p *peer) fetchActiveChanCloser(chanID lnwire.ChannelID) (*channelCloser, e return nil, fmt.Errorf("cannot obtain best block") } - // Before we create the chan closer, we'll start a new - // cooperative channel closure transaction from the chain arb. - // With this context, we'll ensure that we're able to respond - // if *any* of the transactions we sign off on are ever - // broadcast. - closeCtx, err := p.server.chainArb.BeginCoopChanClose( - *channel.ChannelPoint(), - ) - if err != nil { - return nil, err - } - chanCloser = newChannelCloser( chanCloseCfg{ channel: channel, @@ -1595,7 +1583,6 @@ func (p *peer) fetchActiveChanCloser(chanID lnwire.ChannelID) (*channelCloser, e targetFeePerKw, uint32(startingHeight), nil, - closeCtx, ) p.activeChanCloses[chanID] = chanCloser } @@ -1638,20 +1625,6 @@ func (p *peer) handleLocalCloseReq(req *htlcswitch.ChanClose) { return } - // Before we create the chan closer, we'll start a new - // cooperative channel closure transaction from the chain arb. - // With this context, we'll ensure that we're able to respond - // if *any* of the transactions we sign off on are ever - // broadcast. - closeCtx, err := p.server.chainArb.BeginCoopChanClose( - *channel.ChannelPoint(), - ) - if err != nil { - peerLog.Errorf(err.Error()) - req.Err <- err - return - } - // Next, we'll create a new channel closer state machine to // handle the close negotiation. _, startingHeight, err := p.server.cc.chainIO.GetBestBlock() @@ -1671,7 +1644,6 @@ func (p *peer) handleLocalCloseReq(req *htlcswitch.ChanClose) { req.TargetFeePerKw, uint32(startingHeight), req, - closeCtx, ) p.activeChanCloses[chanID] = chanCloser