MCPcopy Create free account
hub / github.com/citp/BlockSci / isValidPubkey

Function isValidPubkey

tools/parser/script_output.cpp:19–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17using namespace blocksci;
18
19bool isValidPubkey(ranges::subrange<const unsigned char *> &vch1) {
20 if (vch1.size() < 33 || vch1.size() > 65) {
21 return false;
22 }
23
24 auto chHeader = static_cast<char>(vch1[0]);
25 if ((chHeader == 2 || chHeader == 3) && vch1.size() == 33) {
26 return true;
27 } else if ((chHeader == 4 || chHeader == 6 || chHeader == 7) && vch1.size() == 65) {
28 return true;
29 }
30
31 return false;
32}
33
34using ScriptOutputDataType = blocksci::to_variadic_t<blocksci::to_address_tuple_t<ScriptOutputData>, mpark::variant>;
35using valtype = ranges::subrange<const unsigned char *>;

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected