Changeset View
Changeset View
Standalone View
Standalone View
src/core_write.cpp
Show All 28 Lines | |||||
std::string FormatScript(const CScript &script) { | std::string FormatScript(const CScript &script) { | ||||
std::string ret; | std::string ret; | ||||
CScript::const_iterator it = script.begin(); | CScript::const_iterator it = script.begin(); | ||||
opcodetype op; | opcodetype op; | ||||
while (it != script.end()) { | while (it != script.end()) { | ||||
CScript::const_iterator it2 = it; | CScript::const_iterator it2 = it; | ||||
std::vector<uint8_t> vch; | std::vector<uint8_t> vch; | ||||
if (script.GetOp2(it, op, &vch)) { | if (script.GetOp(it, op, vch)) { | ||||
if (op == OP_0) { | if (op == OP_0) { | ||||
ret += "0 "; | ret += "0 "; | ||||
continue; | continue; | ||||
} | } | ||||
if ((op >= OP_1 && op <= OP_16) || op == OP_1NEGATE) { | if ((op >= OP_1 && op <= OP_16) || op == OP_1NEGATE) { | ||||
ret += strprintf("%i ", op - OP_1NEGATE - 1); | ret += strprintf("%i ", op - OP_1NEGATE - 1); | ||||
continue; | continue; | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |