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

Function WitnessSigOps

src/script/interpreter.cpp:2133–2147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2131}
2132
2133size_t static WitnessSigOps(int witversion, const std::vector<unsigned char>& witprogram, const CScriptWitness& witness)
2134{
2135 if (witversion == 0) {
2136 if (witprogram.size() == WITNESS_V0_KEYHASH_SIZE)
2137 return 1;
2138
2139 if (witprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE && witness.stack.size() > 0) {
2140 CScript subscript(witness.stack.back().begin(), witness.stack.back().end());
2141 return subscript.GetSigOpCount(true);
2142 }
2143 }
2144
2145 // Future flags may be implemented here.
2146 return 0;
2147}
2148
2149size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness& witness, script_verify_flags flags)
2150{

Callers 1

CountWitnessSigOpsFunction · 0.85

Calls 5

sizeMethod · 0.45
beginMethod · 0.45
backMethod · 0.45
endMethod · 0.45
GetSigOpCountMethod · 0.45

Tested by

no test coverage detected