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.
This commit is contained in:
yyforyongyu 2026-04-22 02:09:21 +08:00
parent 818c841ce0
commit 0fc16396bf
No known key found for this signature in database
GPG key ID: 9BCD95C4FF296868

View file

@ -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
}