server: register a taproot tower client

This commit is contained in:
Elle Mouton 2023-05-31 09:48:19 +02:00
parent 3cb194c45e
commit f12cc12da5
No known key found for this signature in database
GPG Key ID: D7D916376026F177
2 changed files with 9 additions and 20 deletions

View File

@ -1043,24 +1043,6 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
return p.cfg.ChainArb.NotifyContractUpdate(*chanPoint, update)
}
var towerClient wtclient.ClientManager
if lnChan.ChanType().IsTaproot() {
// Leave the tower client as nil for now until the tower client
// has support for taproot channels.
//
// If the user has activated the tower client, then add a log
// to explain that any taproot channel updates wil not be
// backed up to a tower.
if p.cfg.TowerClient != nil {
p.log.Debugf("Updates for channel %s will not be "+
"backed up to a watchtower as watchtowers "+
"are not yet taproot channel compatible",
chanPoint)
}
} else {
towerClient = p.cfg.TowerClient
}
//nolint:lll
linkCfg := htlcswitch.ChannelLinkConfig{
Peer: p,
@ -1090,7 +1072,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
MinFeeUpdateTimeout: htlcswitch.DefaultMinLinkFeeUpdateTimeout,
MaxFeeUpdateTimeout: htlcswitch.DefaultMaxLinkFeeUpdateTimeout,
OutgoingCltvRejectDelta: p.cfg.OutgoingCltvRejectDelta,
TowerClient: towerClient,
TowerClient: p.cfg.TowerClient,
MaxOutgoingCltvExpiry: p.cfg.MaxOutgoingCltvExpiry,
MaxFeeAllocation: p.cfg.MaxChannelFeeAllocation,
MaxAnchorsCommitFeeRate: p.cfg.MaxAnchorsCommitFeeRate,

View File

@ -1553,6 +1553,13 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
anchorPolicy := policy
anchorPolicy.BlobType |= blob.Type(blob.FlagAnchorChannel)
// Copy the policy for legacy channels and set the blob flag
// signalling support for taproot channels.
taprootPolicy := policy
taprootPolicy.TxPolicy.BlobType |= blob.Type(
blob.FlagTaprootChannel,
)
s.towerClientMgr, err = wtclient.NewManager(&wtclient.Config{
FetchClosedChannel: fetchClosedChannel,
BuildBreachRetribution: buildBreachRetribution,
@ -1574,7 +1581,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
MinBackoff: 10 * time.Second,
MaxBackoff: 5 * time.Minute,
MaxTasksInMemQueue: cfg.WtClient.MaxTasksInMemQueue,
}, policy, anchorPolicy)
}, policy, anchorPolicy, taprootPolicy)
if err != nil {
return nil, err
}