Merge pull request #7702 from ellemouton/towerClientMux

wtclient: Tower Client Multiplexer
This commit is contained in:
Elle authored and GitHub committed 2023-12-05 12:27:05 +02:00
commit 4fa483f1bc
14 files changed
+1265 -1015

No files matched your search

+5 -17
View File
@@ -268,12 +268,8 @@ type Config struct {
// HtlcNotifier is used when creating a ChannelLink.
HtlcNotifier *htlcswitch.HtlcNotifier
// TowerClient is used by legacy channels to backup revoked states.
TowerClient wtclient.Client
// AnchorTowerClient is used by anchor channels to backup revoked
// states.
AnchorTowerClient wtclient.Client
// TowerClient is used to backup revoked states.
TowerClient wtclient.ClientManager
// DisconnectPeer is used to disconnect this peer if the cooperative close
// process fails.
@@ -1040,14 +1036,8 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
return p.cfg.ChainArb.NotifyContractUpdate(*chanPoint, update)
}
chanType := lnChan.State().ChanType
// Select the appropriate tower client based on the channel type. It's
// okay if the clients are disabled altogether and these values are nil,
// as the link will check for nilness before using either.
var towerClient htlcswitch.TowerClient
switch {
case chanType.IsTaproot():
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.
//
@@ -1060,9 +1050,7 @@ func (p *Brontide) addLink(chanPoint *wire.OutPoint,
"are not yet taproot channel compatible",
chanPoint)
}
case chanType.HasAnchors():
towerClient = p.cfg.AnchorTowerClient
default:
} else {
towerClient = p.cfg.TowerClient
}