input: update IsHtlcSpendRevoke for taproot chans

For taproot channels, the revocation witness is a single sig as the
keyspend path is used.
This commit is contained in:
Olaoluwa Osuntokun 2023-03-01 21:46:13 -08:00
parent 995e6cd66b
commit b39f5884ad
No known key found for this signature in database
GPG Key ID: 3BBD59E99B280306

View File

@ -468,6 +468,13 @@ func SenderHtlcSpendRevoke(signer Signer, signDesc *SignDescriptor,
func IsHtlcSpendRevoke(txIn *wire.TxIn, signDesc *SignDescriptor) (
bool, error) {
// For taproot channels, the revocation path only has a single witness,
// as that's the key spend path.
isTaproot := txscript.IsPayToTaproot(signDesc.Output.PkScript)
if isTaproot {
return len(txIn.Witness) == 1, nil
}
revokeKey, err := deriveRevokePubKey(signDesc)
if err != nil {
return false, err