Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.cpp
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2016 The Bitcoin Core developers | // Copyright (c) 2009-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "primitives/transaction.h" | #include "primitives/transaction.h" | ||||
#include "hash.h" | #include "hash.h" | ||||
#include "tinyformat.h" | #include "tinyformat.h" | ||||
#include "utilstrencodings.h" | #include "utilstrencodings.h" | ||||
std::string COutPoint::ToString() const { | std::string COutPoint::ToString() const { | ||||
return strprintf("COutPoint(%s, %u)", hash.ToString().substr(0, 10), n); | return strprintf("COutPoint(%s, %u)", txid.ToString().substr(0, 10), n); | ||||
} | } | ||||
std::string CTxIn::ToString() const { | std::string CTxIn::ToString() const { | ||||
std::string str; | std::string str; | ||||
str += "CTxIn("; | str += "CTxIn("; | ||||
str += prevout.ToString(); | str += prevout.ToString(); | ||||
if (prevout.IsNull()) { | if (prevout.IsNull()) { | ||||
str += strprintf(", coinbase %s", HexStr(scriptSig)); | str += strprintf(", coinbase %s", HexStr(scriptSig)); | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | str += strprintf("CTransaction(txid=%s, ver=%d, vin.size=%u, vout.size=%u, " | ||||
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 | No newline at end of file |