mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-09 01:32:09 +02:00
config+link: disable watchtower for anchors
This commit is contained in:
@@ -419,7 +419,12 @@ func (l *channelLink) Start() error {
|
|||||||
|
|
||||||
// If the config supplied watchtower client, ensure the channel is
|
// If the config supplied watchtower client, ensure the channel is
|
||||||
// registered before trying to use it during operation.
|
// registered before trying to use it during operation.
|
||||||
if l.cfg.TowerClient != nil {
|
// TODO(halseth): support anchor types for watchtower.
|
||||||
|
state := l.channel.State()
|
||||||
|
if l.cfg.TowerClient != nil && state.ChanType.HasAnchors() {
|
||||||
|
l.log.Warnf("Skipping tower registration for anchor " +
|
||||||
|
"channel type")
|
||||||
|
} else if l.cfg.TowerClient != nil && !state.ChanType.HasAnchors() {
|
||||||
err := l.cfg.TowerClient.RegisterChannel(l.ChanID())
|
err := l.cfg.TowerClient.RegisterChannel(l.ChanID())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -1883,8 +1888,12 @@ func (l *channelLink) handleUpstreamMsg(msg lnwire.Message) {
|
|||||||
|
|
||||||
// If we have a tower client, we'll proceed in backing up the
|
// If we have a tower client, we'll proceed in backing up the
|
||||||
// state that was just revoked.
|
// state that was just revoked.
|
||||||
if l.cfg.TowerClient != nil {
|
// TODO(halseth): support anchor types for watchtower.
|
||||||
state := l.channel.State()
|
state := l.channel.State()
|
||||||
|
if l.cfg.TowerClient != nil && state.ChanType.HasAnchors() {
|
||||||
|
l.log.Warnf("Skipping tower backup for anchor " +
|
||||||
|
"channel type")
|
||||||
|
} else if l.cfg.TowerClient != nil && !state.ChanType.HasAnchors() {
|
||||||
breachInfo, err := lnwallet.NewBreachRetribution(
|
breachInfo, err := lnwallet.NewBreachRetribution(
|
||||||
state, state.RemoteCommitment.CommitHeight-1, 0,
|
state, state.RemoteCommitment.CommitHeight-1, 0,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user