Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.cpp
Show All 24 Lines | std::string CTxIn::ToString() const { | ||||
if (nSequence != SEQUENCE_FINAL) { | if (nSequence != SEQUENCE_FINAL) { | ||||
str += strprintf(", nSequence=%u", nSequence); | str += strprintf(", nSequence=%u", nSequence); | ||||
} | } | ||||
str += ")"; | str += ")"; | ||||
return str; | return str; | ||||
} | } | ||||
std::string CTxOut::ToString() const { | std::string CTxOut::ToString() const { | ||||
return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", | return strprintf("CTxOut(nValue=%d.%08d, scriptPubKey=%s)", nValue / COIN, | ||||
nValue.GetSatoshis() / COIN.GetSatoshis(), | nValue % COIN, HexStr(scriptPubKey).substr(0, 30)); | ||||
nValue.GetSatoshis() % COIN.GetSatoshis(), | |||||
HexStr(scriptPubKey).substr(0, 30)); | |||||
} | } | ||||
CMutableTransaction::CMutableTransaction() | CMutableTransaction::CMutableTransaction() | ||||
: nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} | : nVersion(CTransaction::CURRENT_VERSION), nLockTime(0) {} | ||||
CMutableTransaction::CMutableTransaction(const CTransaction &tx) | CMutableTransaction::CMutableTransaction(const CTransaction &tx) | ||||
: nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), | : nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), | ||||
nLockTime(tx.nLockTime) {} | nLockTime(tx.nLockTime) {} | ||||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | 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 (unsigned int i = 0; i < vin.size(); i++) | for (unsigned int i = 0; i < vin.size(); i++) | ||||
str += " " + vin[i].ToString() + "\n"; | str += " " + vin[i].ToString() + "\n"; | ||||
for (unsigned int i = 0; i < vout.size(); i++) | for (unsigned int i = 0; i < vout.size(); i++) | ||||
str += " " + vout[i].ToString() + "\n"; | str += " " + vout[i].ToString() + "\n"; | ||||
return str; | return str; | ||||
} | } | ||||
No newline at end of file |