input: use script path for revocation clause for to_local output

In this commit, we modify the to_local script to use a script path for
the revocation scenario. With this change, we ensure that the internal
key is always revealed which means the anchor outputs can still always
be swept.
This commit is contained in:
Olaoluwa Osuntokun committed 2023-08-22 16:30:28 -07:00
1 parent 7f05c765c3
commit 8fc8640432
2 files changed
+74 -27

No files matched your search

+3 -3
View File
@@ -977,7 +977,6 @@ func localCommitSweepWitGen(sigHash txscript.SigHashType,
return TaprootCommitSpendSuccess(
signer, signDesc, spendTx,
commitScriptTree.revokeKey.PubKey(),
commitScriptTree.TapscriptTree,
)
}
@@ -1000,17 +999,18 @@ func localCommitRevokeWitGen(sigHash txscript.SigHashType,
KeyDesc: keychain.KeyDescriptor{
PubKey: revokeKey.PubKey(),
},
WitnessScript: commitScriptTree.RevocationLeaf.Script,
Output: commitScriptTree.txOut,
HashType: sigHash,
InputIndex: 0,
SigHashes: hashCache,
SignMethod: TaprootKeySpendSignMethod,
TapTweak: commitScriptTree.TapscriptRoot,
SignMethod: TaprootScriptSpendSignMethod,
PrevOutputFetcher: prevOuts,
}
return TaprootCommitSpendRevoke(
signer, signDesc, spendTx,
commitScriptTree.TapscriptTree,
)
}
}