VerifyScript

Verify that an input's scriptSig and witness satisfy the output's scriptPubKey.

Synopsis

Declared in <script/interpreter.h>

bool
VerifyScript(
    CScript const& scriptSig,
    CScript const& scriptPubKey,
    CScriptWitness const* witness,
    script_verify_flags flags,
    BaseSignatureChecker const& checker,
    ScriptError* serror = nullptr);

Return Value

true if the spend is valid under the given flags.

Parameters

NameDescription
scriptSigThe input's signature script.
scriptPubKeyThe output script being spent.
witnessThe input's witness stack, or null when absent.
flagsThe active script verification flags.
checkerThe signature checker bound to the spending transaction.
serrorSet to the script error when verification fails.