lnwallet: export GenTaprootHtlcScript

This commit is contained in:
Oliver Gugger 2024-04-11 14:23:59 +02:00
parent cf2174fc2d
commit f0648e24a5
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -1075,9 +1075,9 @@ func genSegwitV0HtlcScript(chanType channeldb.ChannelType,
}, nil }, nil
} }
// genTaprootHtlcScript generates the HTLC scripts for a taproot+musig2 // GenTaprootHtlcScript generates the HTLC scripts for a taproot+musig2
// channel. // channel.
func genTaprootHtlcScript(isIncoming bool, whoseCommit lntypes.ChannelParty, func GenTaprootHtlcScript(isIncoming bool, whoseCommit lntypes.ChannelParty,
timeout uint32, rHash [32]byte, keyRing *CommitmentKeyRing, timeout uint32, rHash [32]byte, keyRing *CommitmentKeyRing,
) (*input.HtlcScriptTree, error) { ) (*input.HtlcScriptTree, error) {
@ -1138,8 +1138,7 @@ func genTaprootHtlcScript(isIncoming bool, whoseCommit lntypes.ChannelParty,
// along side the multiplexer. // along side the multiplexer.
func genHtlcScript(chanType channeldb.ChannelType, isIncoming bool, func genHtlcScript(chanType channeldb.ChannelType, isIncoming bool,
whoseCommit lntypes.ChannelParty, timeout uint32, rHash [32]byte, whoseCommit lntypes.ChannelParty, timeout uint32, rHash [32]byte,
keyRing *CommitmentKeyRing, keyRing *CommitmentKeyRing) (input.ScriptDescriptor, error) {
) (input.ScriptDescriptor, error) {
if !chanType.IsTaproot() { if !chanType.IsTaproot() {
return genSegwitV0HtlcScript( return genSegwitV0HtlcScript(
@ -1148,7 +1147,7 @@ func genHtlcScript(chanType channeldb.ChannelType, isIncoming bool,
) )
} }
return genTaprootHtlcScript( return GenTaprootHtlcScript(
isIncoming, whoseCommit, timeout, rHash, keyRing, isIncoming, whoseCommit, timeout, rHash, keyRing,
) )
} }