MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ExpectedWitnessStackSize

Function ExpectedWitnessStackSize

src/bench/verify_script.cpp:35–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33};
34
35static size_t ExpectedWitnessStackSize(ScriptType script_type)
36{
37 switch (script_type) {
38 case ScriptType::P2WPKH: return 2; // [pubkey, signature]
39 case ScriptType::P2TR_KeyPath: return 1; // [signature]
40 case ScriptType::P2TR_ScriptPath: return 3; // [signature, tapscript, control block]
41 } // no default case, so the compiler can warn about missing cases
42 assert(false);
43}
44
45// Microbenchmark for verification of standard scripts.
46static void VerifyScriptBench(benchmark::Bench& bench, ScriptType script_type)

Callers 1

VerifyScriptBenchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected