mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-21 14:10:35 +02:00
multi: send channel update with disabled active on force and coop chan closes
This commit is contained in:
@@ -122,6 +122,10 @@ type ChainArbitratorConfig struct {
|
||||
|
||||
// ChainIO allows us to query the state of the current main chain.
|
||||
ChainIO lnwallet.BlockChainIO
|
||||
|
||||
// DisableChannel disables a channel, resulting in it not being able to
|
||||
// forward payments.
|
||||
DisableChannel func(wire.OutPoint) error
|
||||
}
|
||||
|
||||
// ChainArbitrator is a sub-system that oversees the on-chain resolution of all
|
||||
@@ -667,6 +671,16 @@ func (c *ChainArbitrator) ForceCloseContract(chanPoint wire.OutPoint) (*wire.Msg
|
||||
return nil, fmt.Errorf("ChainArbitrator shutting down")
|
||||
}
|
||||
|
||||
// We'll attempt to disable the channel in the background to
|
||||
// avoid blocking due to sending the update message to all
|
||||
// active peers.
|
||||
go func() {
|
||||
if err := c.cfg.DisableChannel(chanPoint); err != nil {
|
||||
log.Errorf("Unable to disable channel %v on "+
|
||||
"close: %v", chanPoint, err)
|
||||
}
|
||||
}()
|
||||
|
||||
return closeTx, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user