Changeset View
Changeset View
Standalone View
Standalone View
src/core_write.cpp
Show All 29 Lines | while (it != script.end()) { | ||||
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; | ||||
} | } | ||||
if (op >= OP_NOP && op <= OP_NOP10) { | if (op >= OP_NOP && op < FIRST_UNDEFINED_OP_VALUE) { | ||||
std::string str(GetOpName(op)); | std::string str(GetOpName(op)); | ||||
if (str.substr(0, 3) == std::string("OP_")) { | if (str.substr(0, 3) == std::string("OP_")) { | ||||
ret += str.substr(3, std::string::npos) + " "; | ret += str.substr(3, std::string::npos) + " "; | ||||
continue; | continue; | ||||
} | } | ||||
} | } | ||||
if (vch.size() > 0) { | if (vch.size() > 0) { | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, | ||||
UniValue vout(UniValue::VARR); | UniValue vout(UniValue::VARR); | ||||
for (unsigned int i = 0; i < tx.vout.size(); i++) { | for (unsigned int i = 0; i < tx.vout.size(); i++) { | ||||
const CTxOut &txout = tx.vout[i]; | const CTxOut &txout = tx.vout[i]; | ||||
UniValue out(UniValue::VOBJ); | UniValue out(UniValue::VOBJ); | ||||
UniValue outValue(UniValue::VNUM, FormatMoney(txout.nValue)); | UniValue outValue(UniValue::VNUM, FormatMoney(txout.nValue)); | ||||
out.pushKV("value", outValue); | out.pushKV("value", outValue); | ||||
out.pushKV("n", (int64_t)i); | out.pushKV("n", int64_t(i)); | ||||
UniValue o(UniValue::VOBJ); | UniValue o(UniValue::VOBJ); | ||||
ScriptPubKeyToUniv(txout.scriptPubKey, o, true); | ScriptPubKeyToUniv(txout.scriptPubKey, o, true); | ||||
out.pushKV("scriptPubKey", o); | out.pushKV("scriptPubKey", o); | ||||
vout.push_back(out); | vout.push_back(out); | ||||
} | } | ||||
entry.pushKV("vout", vout); | entry.pushKV("vout", vout); | ||||
Show All 9 Lines |