watchtower/wtclient: prep client for taproot towers

This commit is contained in:
Elle Mouton
2023-05-31 09:44:28 +02:00
parent c50aa10194
commit 660f1f361e
7 changed files with 207 additions and 56 deletions

View File

@@ -80,6 +80,19 @@ const (
TypeAltruistTaprootCommit = Type(FlagCommitOutputs | FlagTaprootChannel)
)
// TypeFromChannel returns the appropriate blob Type for the given channel
// type.
func TypeFromChannel(chanType channeldb.ChannelType) Type {
switch {
case chanType.IsTaproot():
return TypeAltruistTaprootCommit
case chanType.HasAnchors():
return TypeAltruistAnchorCommit
default:
return TypeAltruistCommit
}
}
// Identifier returns a unique, stable string identifier for the blob Type.
func (t Type) Identifier() (string, error) {
switch t {