MCPcopy Create free account
hub / github.com/ElementsProject/elements / WitnessSigOps

Function WitnessSigOps

src/script/interpreter.cpp:3503–3517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3501}
3502
3503size_t static WitnessSigOps(int witversion, const std::vector<unsigned char>& witprogram, const CScriptWitness& witness)
3504{
3505 if (witversion == 0) {
3506 if (witprogram.size() == WITNESS_V0_KEYHASH_SIZE)
3507 return 1;
3508
3509 if (witprogram.size() == WITNESS_V0_SCRIPTHASH_SIZE && witness.stack.size() > 0) {
3510 CScript subscript(witness.stack.back().begin(), witness.stack.back().end());
3511 return subscript.GetSigOpCount(true);
3512 }
3513 }
3514
3515 // Future flags may be implemented here.
3516 return 0;
3517}
3518
3519size_t CountWitnessSigOps(const CScript& scriptSig, const CScript& scriptPubKey, const CScriptWitness* witness, unsigned int flags)
3520{

Callers 1

CountWitnessSigOpsFunction · 0.85

Calls 4

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

Tested by

no test coverage detected