Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.cpp
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | for (const auto &nVin : vin) { | ||||
if (nTxSize > offset) { | if (nTxSize > offset) { | ||||
nTxSize -= offset; | nTxSize -= offset; | ||||
} | } | ||||
} | } | ||||
return nTxSize; | return nTxSize; | ||||
} | } | ||||
unsigned int CTransaction::GetTotalSize() const { | unsigned int CTransaction::GetTotalSize() const { | ||||
return ::GetSerializeSize(*this, SER_NETWORK, PROTOCOL_VERSION); | return ::GetSerializeSize(*this, PROTOCOL_VERSION); | ||||
} | } | ||||
std::string CTransaction::ToString() const { | std::string CTransaction::ToString() const { | ||||
std::string str; | std::string str; | ||||
str += strprintf("CTransaction(txid=%s, ver=%d, vin.size=%u, vout.size=%u, " | str += strprintf("CTransaction(txid=%s, ver=%d, vin.size=%u, vout.size=%u, " | ||||
"nLockTime=%u)\n", | "nLockTime=%u)\n", | ||||
GetId().ToString().substr(0, 10), nVersion, vin.size(), | GetId().ToString().substr(0, 10), nVersion, vin.size(), | ||||
vout.size(), nLockTime); | vout.size(), nLockTime); | ||||
for (const auto &nVin : vin) { | for (const auto &nVin : vin) { | ||||
str += " " + nVin.ToString() + "\n"; | str += " " + nVin.ToString() + "\n"; | ||||
} | } | ||||
for (const auto &nVout : vout) { | for (const auto &nVout : vout) { | ||||
str += " " + nVout.ToString() + "\n"; | str += " " + nVout.ToString() + "\n"; | ||||
} | } | ||||
return str; | return str; | ||||
} | } |