mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-20 04:35:31 +01:00
peer: don't pass closeCtx to chanCloser
This commit is contained in:
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")
|
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(
|
chanCloser = newChannelCloser(
|
||||||
chanCloseCfg{
|
chanCloseCfg{
|
||||||
channel: channel,
|
channel: channel,
|
||||||
@@ -1595,7 +1583,6 @@ func (p *peer) fetchActiveChanCloser(chanID lnwire.ChannelID) (*channelCloser, e
|
|||||||
targetFeePerKw,
|
targetFeePerKw,
|
||||||
uint32(startingHeight),
|
uint32(startingHeight),
|
||||||
nil,
|
nil,
|
||||||
closeCtx,
|
|
||||||
)
|
)
|
||||||
p.activeChanCloses[chanID] = chanCloser
|
p.activeChanCloses[chanID] = chanCloser
|
||||||
}
|
}
|
||||||
@@ -1638,20 +1625,6 @@ func (p *peer) handleLocalCloseReq(req *htlcswitch.ChanClose) {
|
|||||||
return
|
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
|
// Next, we'll create a new channel closer state machine to
|
||||||
// handle the close negotiation.
|
// handle the close negotiation.
|
||||||
_, startingHeight, err := p.server.cc.chainIO.GetBestBlock()
|
_, startingHeight, err := p.server.cc.chainIO.GetBestBlock()
|
||||||
@@ -1671,7 +1644,6 @@ func (p *peer) handleLocalCloseReq(req *htlcswitch.ChanClose) {
|
|||||||
req.TargetFeePerKw,
|
req.TargetFeePerKw,
|
||||||
uint32(startingHeight),
|
uint32(startingHeight),
|
||||||
req,
|
req,
|
||||||
closeCtx,
|
|
||||||
)
|
)
|
||||||
p.activeChanCloses[chanID] = chanCloser
|
p.activeChanCloses[chanID] = chanCloser
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user