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

Function CheckPubKeyEncoding

src/script/interpreter.cpp:313–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

311}
312
313bool static CheckPubKeyEncoding(const valtype &vchPubKey, unsigned int flags, const SigVersion &sigversion, ScriptError* serror) {
314 if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchPubKey)) {
315 return set_error(serror, SCRIPT_ERR_PUBKEYTYPE);
316 }
317 // Only compressed keys are accepted in segwit
318 if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SigVersion::WITNESS_V0 && !IsCompressedPubKey(vchPubKey)) {
319 return set_error(serror, SCRIPT_ERR_WITNESS_PUBKEYTYPE);
320 }
321 return true;
322}
323
324bool CheckMinimalPush(const valtype& data, opcodetype opcode) {
325 // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal

Callers 2

EvalChecksigPreTapscriptFunction · 0.85
EvalScriptFunction · 0.85

Calls 3

IsCompressedPubKeyFunction · 0.85
set_errorFunction · 0.70

Tested by

no test coverage detected