mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-24 06:47:59 +01:00
txscript: disable OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY for tapscript
This commit is contained in:
parent
c1eb15044e
commit
a7a8ad7d37
1 changed files with 11 additions and 1 deletions
|
@ -2065,6 +2065,14 @@ type parsedSigInfo struct {
|
||||||
// Stack transformation:
|
// Stack transformation:
|
||||||
// [... dummy [sig ...] numsigs [pubkey ...] numpubkeys] -> [... bool]
|
// [... dummy [sig ...] numsigs [pubkey ...] numpubkeys] -> [... bool]
|
||||||
func opcodeCheckMultiSig(op *opcode, data []byte, vm *Engine) error {
|
func opcodeCheckMultiSig(op *opcode, data []byte, vm *Engine) error {
|
||||||
|
// If we're doing tapscript execution, then this op code is disabled.
|
||||||
|
if vm.taprootCtx != nil {
|
||||||
|
str := fmt.Sprintf("OP_CHECKMULTISIG and " +
|
||||||
|
"OP_CHECKMULTISIGVERIFY are disabled during " +
|
||||||
|
"tapscript execution")
|
||||||
|
return scriptError(ErrTapscriptCheckMultisig, str)
|
||||||
|
}
|
||||||
|
|
||||||
numKeys, err := vm.dstack.PopInt()
|
numKeys, err := vm.dstack.PopInt()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -2236,7 +2244,9 @@ func opcodeCheckMultiSig(op *opcode, data []byte, vm *Engine) error {
|
||||||
if vm.hashCache != nil {
|
if vm.hashCache != nil {
|
||||||
sigHashes = vm.hashCache
|
sigHashes = vm.hashCache
|
||||||
} else {
|
} else {
|
||||||
sigHashes = NewTxSigHashes(&vm.tx, vm.prevOutFetcher)
|
sigHashes = NewTxSigHashes(
|
||||||
|
&vm.tx, vm.prevOutFetcher,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
hash, err = calcWitnessSignatureHashRaw(script, sigHashes, hashType,
|
hash, err = calcWitnessSignatureHashRaw(script, sigHashes, hashType,
|
||||||
|
|
Loading…
Add table
Reference in a new issue