mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
peer: update WipeChannel method to match recent htlcswitch API change
This commit is contained in:
parent
25082f0b5b
commit
1cf1d250b3
16
peer.go
16
peer.go
@ -1932,19 +1932,17 @@ func (p *peer) sendShutdown(channel *lnwallet.LightningChannel,
|
||||
// Prevent the HTLC switch from receiving additional HTLCs for this
|
||||
// channel.
|
||||
p.server.htlcSwitch.RemoveLink(chanID)
|
||||
// WipeChannel removes the passed channel point from all indexes associated
|
||||
// with the peer, and the switch.
|
||||
func (p *peer) WipeChannel(chanPoint *wire.OutPoint) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WipeChannel removes the passed channel from all indexes associated with the
|
||||
// peer, and deletes the channel from the database.
|
||||
func (p *peer) WipeChannel(channel *lnwallet.LightningChannel) error {
|
||||
channel.Stop()
|
||||
|
||||
chanID := lnwire.NewChanIDFromOutPoint(channel.ChannelPoint())
|
||||
chanID := lnwire.NewChanIDFromOutPoint(chanPoint)
|
||||
|
||||
p.activeChanMtx.Lock()
|
||||
if channel, ok := p.activeChannels[chanID]; ok {
|
||||
channel.Stop()
|
||||
delete(p.activeChannels, chanID)
|
||||
}
|
||||
p.activeChanMtx.Unlock()
|
||||
|
||||
// Instruct the HtlcSwitch to close this link as the channel is no
|
||||
|
Loading…
Reference in New Issue
Block a user