Changeset View
Changeset View
Standalone View
Standalone View
src/core_write.cpp
Show First 20 Lines • Show All 216 Lines • ▼ Show 20 Lines | void ScriptPubKeyToUniv(const CScript &scriptPubKey, UniValue &out, | ||||
out.pushKV("addresses", a); | out.pushKV("addresses", a); | ||||
} | } | ||||
void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | void TxToUniv(const CTransaction &tx, const uint256 &hashBlock, UniValue &entry, | ||||
bool include_hex, int serialize_flags) { | bool include_hex, int serialize_flags) { | ||||
entry.pushKV("txid", tx.GetId().GetHex()); | entry.pushKV("txid", tx.GetId().GetHex()); | ||||
entry.pushKV("hash", tx.GetHash().GetHex()); | entry.pushKV("hash", tx.GetHash().GetHex()); | ||||
entry.pushKV("version", tx.nVersion); | entry.pushKV("version", tx.nVersion); | ||||
entry.pushKV("size", | entry.pushKV("size", (int)::GetSerializeSize(tx, PROTOCOL_VERSION)); | ||||
(int)::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)); | |||||
entry.pushKV("locktime", (int64_t)tx.nLockTime); | entry.pushKV("locktime", (int64_t)tx.nLockTime); | ||||
UniValue vin(UniValue::VARR); | UniValue vin(UniValue::VARR); | ||||
for (unsigned int i = 0; i < tx.vin.size(); i++) { | for (unsigned int i = 0; i < tx.vin.size(); i++) { | ||||
const CTxIn &txin = tx.vin[i]; | const CTxIn &txin = tx.vin[i]; | ||||
UniValue in(UniValue::VOBJ); | UniValue in(UniValue::VOBJ); | ||||
if (tx.IsCoinBase()) { | if (tx.IsCoinBase()) { | ||||
in.pushKV("coinbase", | in.pushKV("coinbase", | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |