From 0fc16396bf86df60ed612e46ea68c86b03dde1ef Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Wed, 22 Apr 2026 02:09:21 +0800 Subject: [PATCH] txscript: align empty CHECKSIG pubkey validation with Core The refreshed Bitcoin Core script reference tests cover cases where an empty CHECKSIG input must still fail pubkey encoding checks before the interpreter falls back to a generic false result. --- txscript/opcode.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/txscript/opcode.go b/txscript/opcode.go index 770e5b47..e2170e65 100644 --- a/txscript/opcode.go +++ b/txscript/opcode.go @@ -1996,6 +1996,10 @@ func opcodeCheckSig(op *opcode, data []byte, vm *Engine) error { // This only applies if tapscript verification isn't active, as this // check is done within the sighash itself. if vm.taprootCtx == nil && len(fullSigBytes) < 1 { + if err := vm.checkPubKeyEncoding(pkBytes); err != nil { + return err + } + vm.dstack.PushBool(false) return nil }