MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / CheckPubKeyEncoding

Function CheckPubKeyEncoding

src/script/interpreter.cpp:245–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245bool static CheckPubKeyEncoding(const valtype &vchPubKey, unsigned int flags, const SigVersion &sigversion, ScriptError* serror) {
246 if ((flags & SCRIPT_VERIFY_STRICTENC) != 0 && !IsCompressedOrUncompressedPubKey(vchPubKey)) {
247 return set_error(serror, SCRIPT_ERR_PUBKEYTYPE);
248 }
249 // Only compressed keys are accepted in segwit
250 if ((flags & SCRIPT_VERIFY_WITNESS_PUBKEYTYPE) != 0 && sigversion == SigVersion::WITNESS_V0 && !IsCompressedPubKey(vchPubKey)) {
251 return set_error(serror, SCRIPT_ERR_WITNESS_PUBKEYTYPE);
252 }
253 return true;
254}
255
256bool static CheckMinimalPush(const valtype& data, opcodetype opcode) {
257 // Excludes OP_1NEGATE, OP_1-16 since they are by definition minimal

Callers 1

EvalScriptFunction · 0.85

Calls 3

IsCompressedPubKeyFunction · 0.85
set_errorFunction · 0.70

Tested by

no test coverage detected