mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-04-09 12:48:06 +02:00
peer: don't pass closeCtx to chanCloser
This commit is contained in:
parent
0809880426
commit
bb611e065d
28
peer.go
28
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user