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

Method OpCodeParser

src/core_io.cpp:57–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56public:
57 OpCodeParser()
58 {
59 for (unsigned int op = 0; op <= MAX_OPCODE; ++op) {
60 // Allow OP_RESERVED to get into mapOpNames
61 if (op < OP_NOP && op != OP_RESERVED) {
62 continue;
63 }
64
65 std::string strName = GetOpName(static_cast<opcodetype>(op));
66 if (strName == "OP_UNKNOWN") {
67 continue;
68 }
69 mapOpNames[strName] = static_cast<opcodetype>(op);
70 // Convenience: OP_ADD and just ADD are both recognized:
71 if (strName.starts_with("OP_")) {
72 mapOpNames[strName.substr(3)] = static_cast<opcodetype>(op);
73 }
74 }
75 }
76 opcodetype Parse(const std::string& s) const
77 {
78 auto it = mapOpNames.find(s);

Callers

nothing calls this directly

Calls 1

GetOpNameFunction · 0.85

Tested by

no test coverage detected